質問編集履歴

5

修正

2020/01/15 15:50

投稿

big_sky
big_sky

スコア23

test CHANGED
File without changes
test CHANGED
@@ -456,55 +456,47 @@
456
456
 
457
457
  ```ここに言語を入力
458
458
 
459
- bitbucket-pipelines.yml
460
-
461
-
462
-
463
- - composer
464
-
465
- deployment: production
466
-
467
- script:
459
+ Vagrantfile
468
-
460
+
461
+
462
+
469
- # - apt-get update
463
+ # -*- mode: ruby -*-
470
-
471
- - apt install -y zip
464
+
472
-
473
- - cd apps/codeigniter
474
-
475
- - sed -i -e "s/<<version>>/$BITBUCKET_TAG/" application/config/app_config.php
476
-
477
- - composer install
465
+ # vi: set ft=ruby :
478
-
479
- # - python sitevar.py > vars/site_vars.yml
466
+
480
-
481
- - zip -r /tmp/artifact.zip .
467
+
482
-
483
- - cd ../../
468
+
484
-
485
- - python codedeploy_deploy.py
469
+ Vagrant.configure(2) do |config|
486
-
487
-
488
-
489
- definitions:
470
+
490
-
491
- services:
471
+
492
-
493
- postgres:
472
+
494
-
495
- image: postgres
473
+ config.vm.provider "virtualbox" do |v|
496
-
497
- environment:
474
+
498
-
499
- TZ: "Asia/Tokyo"
475
+ v.name = "wardishdir"
500
-
476
+
501
- POSTGRES_DB: wardishdir
477
+ v.memory = "2048"
478
+
502
-
479
+ end
480
+
481
+
482
+
503
- POSTGRES_USER: wardish
483
+ config.vm.box = "bento/centos-7.3"
504
-
484
+
485
+
486
+
505
- DATABASE_URL: postgres://wardish@localhost:5432/wardishdir
487
+ config.vm.network "private_network", ip: "192.168.33.19"
488
+
489
+
490
+
506
-
491
+ config.vm.provision :ansible_local do |ansible|
492
+
507
-
493
+ ansible.playbook = "playbook.yml"
494
+
495
+ end
496
+
497
+
498
+
499
+ end
508
500
 
509
501
 
510
502
 
@@ -512,56 +504,6 @@
512
504
 
513
505
 
514
506
 
515
- ```ここに言語を入力
516
-
517
- Vagrantfile
518
-
519
-
520
-
521
- # -*- mode: ruby -*-
522
-
523
- # vi: set ft=ruby :
524
-
525
-
526
-
527
- Vagrant.configure(2) do |config|
528
-
529
-
530
-
531
- config.vm.provider "virtualbox" do |v|
532
-
533
- v.name = "wardishdir"
534
-
535
- v.memory = "2048"
536
-
537
- end
538
-
539
-
540
-
541
- config.vm.box = "bento/centos-7.3"
542
-
543
-
544
-
545
- config.vm.network "private_network", ip: "192.168.33.19"
546
-
547
-
548
-
549
- config.vm.provision :ansible_local do |ansible|
550
-
551
- ansible.playbook = "playbook.yml"
552
-
553
- end
554
-
555
-
556
-
557
- end
558
-
559
-
560
-
561
- ```
562
-
563
-
564
-
565
507
  他にもvagrant mount フォルダ共有ができない問題などがありましたが、そこはvagrant plugin install vagrant-vbguestで解決することができ、最後にこのエラーとずっと向き合っています。
566
508
 
567
509
  どなたか助言をいただけると助かります。

4

追記

2020/01/15 15:50

投稿

big_sky
big_sky

スコア23

test CHANGED
File without changes
test CHANGED
@@ -32,6 +32,374 @@
32
32
 
33
33
 
34
34
 
35
+ - hosts: all
36
+
37
+ become: true
38
+
39
+ tasks:
40
+
41
+ - name: yum update
42
+
43
+ yum:
44
+
45
+ name: "*"
46
+
47
+ state: latest
48
+
49
+ update_cache: yes
50
+
51
+
52
+
53
+ - name: set timezone to Asia/Tokyo
54
+
55
+ timezone:
56
+
57
+ name: Asia/Tokyo
58
+
59
+
60
+
61
+ - name: to selinux
62
+
63
+ yum:
64
+
65
+ name: libselinux-python
66
+
67
+
68
+
69
+ - name: install yum repositories
70
+
71
+ yum:
72
+
73
+ name:
74
+
75
+ - epel-release
76
+
77
+ - http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
78
+
79
+ - https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
80
+
81
+
82
+
83
+ - name: yarn repo
84
+
85
+ shell: yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo; yum makecache fast
86
+
87
+ args:
88
+
89
+ chdir: /etc/yum.repos.d
90
+
91
+ creates: yarn.repo
92
+
93
+
94
+
95
+ - name: nodejs8 repo
96
+
97
+ shell: curl -sL https://rpm.nodesource.com/setup_8.x | bash -
98
+
99
+ args:
100
+
101
+ creates: /etc/yum.repos.d/nodesource-el7.repo
102
+
103
+
104
+
105
+ - name: install packages
106
+
107
+ yum:
108
+
109
+ enablerepo: remi-php56
110
+
111
+ name:
112
+
113
+ - httpd
114
+
115
+ - php
116
+
117
+ - php-xml
118
+
119
+ - php-pdo
120
+
121
+ - php-mbstring
122
+
123
+ - php-pgsql
124
+
125
+ - php-cli
126
+
127
+ - php-common
128
+
129
+ - postgresql96
130
+
131
+ - postgresql96-contrib
132
+
133
+ - postgresql96-server
134
+
135
+ - python-psycopg2
136
+
137
+
138
+
139
+ - name: check database exists
140
+
141
+ stat:
142
+
143
+ path: /var/lib/pgsql/9.6/data/pg_hba.conf
144
+
145
+ register: pgsql_data_hba_conf
146
+
147
+
148
+
149
+ - name: initdb
150
+
151
+ command: /usr/pgsql-9.6/bin/postgresql96-setup initdb
152
+
153
+ when: pgsql_data_hba_conf.stat.exists == false
154
+
155
+
156
+
157
+ - name: edit pg_hba.conf
158
+
159
+ lineinfile:
160
+
161
+ dest: /var/lib/pgsql/9.6/data/pg_hba.conf
162
+
163
+ regexp: '{{ item.regexp }}'
164
+
165
+ line: '{{ item.line }}'
166
+
167
+ backrefs: yes
168
+
169
+ with_items:
170
+
171
+ - regexp: '^(local.+) peer$'
172
+
173
+ line: '\1 trust'
174
+
175
+ - regexp: '^(host.+) ident$'
176
+
177
+ line: '\1 trust'
178
+
179
+ - regexp: '^(host.+) ident$'
180
+
181
+ line: '\1 trust'
182
+
183
+
184
+
185
+ - name: install composer
186
+
187
+ shell: curl -sS https://getcomposer.org/installer| php -- --install-dir=/usr/local/bin && mv /usr/local/bin/composer.phar /usr/local/bin/composer
188
+
189
+ args:
190
+
191
+ creates: /usr/local/bin/composer
192
+
193
+
194
+
195
+ - name: make composer executable
196
+
197
+ file:
198
+
199
+ path: /usr/local/bin/composer
200
+
201
+ mode: a+x
202
+
203
+ state: file
204
+
205
+
206
+
207
+ - name: install yarn
208
+
209
+ shell: curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
210
+
211
+
212
+
213
+ - name: import gpg key
214
+
215
+ shell: sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
216
+
217
+
218
+
219
+ - name: install packages
220
+
221
+ yum:
222
+
223
+ name:
224
+
225
+ - nodejs
226
+
227
+ - make
228
+
229
+ - yarn
230
+
231
+ - gcc-c++
232
+
233
+
234
+
235
+ - name: install webpack
236
+
237
+ shell: yarn add webpack webpack-cli
238
+
239
+ become: true
240
+
241
+ become_user: vagrant
242
+
243
+ args:
244
+
245
+ chdir: /home/vagrant
246
+
247
+
248
+
249
+ - name: setting bash_profile
250
+
251
+ template:
252
+
253
+ src: resources/bash_profile.j2
254
+
255
+ dest: /home/vagrant/.bash_profile
256
+
257
+
258
+
259
+ - name: app.conf
260
+
261
+ copy:
262
+
263
+ dest: /etc/httpd/conf.d/wardishdir.conf
264
+
265
+ content: |
266
+
267
+ Alias /wardishdir2 /vagrant/apps/codeigniter
268
+
269
+
270
+
271
+ SetEnv CI_PUBLIC "public"
272
+
273
+ SetEnv CI_DB_NAME "wardish"
274
+
275
+ SetEnv CI_DB_USER "wardishdir01"
276
+
277
+ SetEnv CI_DB_PASSWORD "wardishdir01"
278
+
279
+ SetEnv CI_DB_HOST "localhost"
280
+
281
+
282
+
283
+ <Directory /vagrant/apps/codeigniter>
284
+
285
+ AllowOverride All
286
+
287
+ EnableMMAP Off
288
+
289
+ EnableSendfile Off
290
+
291
+ Require all granted
292
+
293
+ </Directory>
294
+
295
+
296
+
297
+ - name: create directories
298
+
299
+ file:
300
+
301
+ path: '{{ item }}'
302
+
303
+ state: directory
304
+
305
+ owner: root
306
+
307
+ mode: 777
308
+
309
+ with_items:
310
+
311
+ - /var/wardishdir/construction/import_files
312
+
313
+ - /var/wardishdir/construction/attachment_files
314
+
315
+ - /var/wardishdir/log
316
+
317
+
318
+
319
+ - name: setting php
320
+
321
+ lineinfile:
322
+
323
+ dest: /etc/php.ini
324
+
325
+ state: present
326
+
327
+ backrefs: yes
328
+
329
+ regexp: '{{ item.regexp }}'
330
+
331
+ line: '{{ item.line }}'
332
+
333
+ with_items:
334
+
335
+ - regexp: '^;(date.timezone) =.*'
336
+
337
+ line: '\1 = Asia/Tokyo'
338
+
339
+ - regexp: '^;(mbstring.language) =.*'
340
+
341
+ line: '\1 = Japanese'
342
+
343
+ - regexp: '^;(mbstring.internal_encoding) =.*'
344
+
345
+ line: '\1 = UTF-8'
346
+
347
+ - regexp: '^;(mbstring.http_input) =.*'
348
+
349
+ line: '\1 = pass'
350
+
351
+ - regexp: '^;(mbstring.http_output) =.*'
352
+
353
+ line: '\1 = pass'
354
+
355
+ - regexp: '^;(mbstring.encoding_translation) =.*'
356
+
357
+ line: '\1 = off'
358
+
359
+
360
+
361
+ - name: start services
362
+
363
+ service:
364
+
365
+ name: '{{ item }}'
366
+
367
+ enabled: yes
368
+
369
+ state: restarted
370
+
371
+ with_items:
372
+
373
+ - httpd
374
+
375
+ - postgresql-9.6
376
+
377
+
378
+
379
+ - name: create role
380
+
381
+ postgresql_user:
382
+
383
+ name: wardish
384
+
385
+ password: wardishdir02
386
+
387
+ expires: infinity
388
+
389
+ login_user: postgres
390
+
391
+ login_host: localhost
392
+
393
+
394
+
395
+ - name: create database
396
+
397
+ postgresql_db:
398
+
399
+ name: wardishdir
400
+
401
+ encoding: UTF-8
402
+
35
403
  template: template0
36
404
 
37
405
  owner: wardish
@@ -194,102 +562,6 @@
194
562
 
195
563
 
196
564
 
197
-
198
-
199
- ```ここに言語を入力
200
-
201
- /etc/ansible/hosts
202
-
203
-
204
-
205
- # This is the default ansible 'hosts' file.
206
-
207
- #
208
-
209
- # It should live in /etc/ansible/hosts
210
-
211
- #
212
-
213
- # - Comments begin with the '#' character
214
-
215
- # - Blank lines are ignored
216
-
217
- # - Groups of hosts are delimited by [header] elements
218
-
219
- # - You can enter hostnames or ip addresses
220
-
221
- # - A hostname/ip can be a member of multiple groups
222
-
223
-
224
-
225
- # Ex 1: Ungrouped hosts, specify before any group headers.
226
-
227
-
228
-
229
- ## green.example.com
230
-
231
- ## blue.example.com
232
-
233
- ## 192.168.100.1
234
-
235
- ## 192.168.100.10
236
-
237
-
238
-
239
- # Ex 2: A collection of hosts belonging to the 'webservers' group
240
-
241
-
242
-
243
- ## [webservers]
244
-
245
- ## alpha.example.org
246
-
247
- ## beta.example.org
248
-
249
- ## 192.168.1.100
250
-
251
- ## 192.168.1.110
252
-
253
-
254
-
255
- # If you have multiple hosts following a pattern you can specify
256
-
257
- # them like this:
258
-
259
-
260
-
261
- ## www[001:006].example.com
262
-
263
-
264
-
265
- # Ex 3: A collection of database servers in the 'dbservers' group
266
-
267
-
268
-
269
- ## [dbservers]
270
-
271
- ##
272
-
273
- ## db01.intranet.mydomain.net
274
-
275
- ## db02.intranet.mydomain.net
276
-
277
- ## 10.25.1.56
278
-
279
- ## 10.25.1.57
280
-
281
-
282
-
283
- # Here's another example of host ranges, this time there are no
284
-
285
- # leading 0s:
286
-
287
-
288
-
289
- ## db-[99:101]-node.example.com
290
-
291
- ```
292
-
293
565
  他にもvagrant mount フォルダ共有ができない問題などがありましたが、そこはvagrant plugin install vagrant-vbguestで解決することができ、最後にこのエラーとずっと向き合っています。
294
566
 
295
567
  どなたか助言をいただけると助かります。

3

修正

2020/01/15 15:49

投稿

big_sky
big_sky

スコア23

test CHANGED
File without changes
test CHANGED
@@ -194,57 +194,7 @@
194
194
 
195
195
 
196
196
 
197
- ```ここに言語を入力
197
+
198
-
199
- /etc/ansible/ansible.cfg
200
-
201
-
202
-
203
- [colors]
204
-
205
- #highlight = white
206
-
207
- #verbose = blue
208
-
209
- #warn = bright purple
210
-
211
- #error = red
212
-
213
- #debug = dark gray
214
-
215
- #deprecate = purple
216
-
217
- #skip = cyan
218
-
219
- #unreachable = red
220
-
221
- #ok = green
222
-
223
- #changed = yellow
224
-
225
- #diff_add = green
226
-
227
- #diff_remove = red
228
-
229
- #diff_lines = cyan
230
-
231
-
232
-
233
-
234
-
235
- [diff]
236
-
237
- # Always print diff when running ( same as always running with -D/--diff )
238
-
239
- # always = no
240
-
241
-
242
-
243
- # Set how many context lines to show in diff
244
-
245
- # context = 3
246
-
247
- ```
248
198
 
249
199
  ```ここに言語を入力
250
200
 
@@ -252,7 +202,47 @@
252
202
 
253
203
 
254
204
 
255
-
205
+ # This is the default ansible 'hosts' file.
206
+
207
+ #
208
+
209
+ # It should live in /etc/ansible/hosts
210
+
211
+ #
212
+
213
+ # - Comments begin with the '#' character
214
+
215
+ # - Blank lines are ignored
216
+
217
+ # - Groups of hosts are delimited by [header] elements
218
+
219
+ # - You can enter hostnames or ip addresses
220
+
221
+ # - A hostname/ip can be a member of multiple groups
222
+
223
+
224
+
225
+ # Ex 1: Ungrouped hosts, specify before any group headers.
226
+
227
+
228
+
229
+ ## green.example.com
230
+
231
+ ## blue.example.com
232
+
233
+ ## 192.168.100.1
234
+
235
+ ## 192.168.100.10
236
+
237
+
238
+
239
+ # Ex 2: A collection of hosts belonging to the 'webservers' group
240
+
241
+
242
+
243
+ ## [webservers]
244
+
245
+ ## alpha.example.org
256
246
 
257
247
  ## beta.example.org
258
248
 

2

追記

2020/01/15 15:35

投稿

big_sky
big_sky

スコア23

test CHANGED
File without changes
test CHANGED
@@ -194,6 +194,112 @@
194
194
 
195
195
 
196
196
 
197
+ ```ここに言語を入力
198
+
199
+ /etc/ansible/ansible.cfg
200
+
201
+
202
+
203
+ [colors]
204
+
205
+ #highlight = white
206
+
207
+ #verbose = blue
208
+
209
+ #warn = bright purple
210
+
211
+ #error = red
212
+
213
+ #debug = dark gray
214
+
215
+ #deprecate = purple
216
+
217
+ #skip = cyan
218
+
219
+ #unreachable = red
220
+
221
+ #ok = green
222
+
223
+ #changed = yellow
224
+
225
+ #diff_add = green
226
+
227
+ #diff_remove = red
228
+
229
+ #diff_lines = cyan
230
+
231
+
232
+
233
+
234
+
235
+ [diff]
236
+
237
+ # Always print diff when running ( same as always running with -D/--diff )
238
+
239
+ # always = no
240
+
241
+
242
+
243
+ # Set how many context lines to show in diff
244
+
245
+ # context = 3
246
+
247
+ ```
248
+
249
+ ```ここに言語を入力
250
+
251
+ /etc/ansible/hosts
252
+
253
+
254
+
255
+
256
+
257
+ ## beta.example.org
258
+
259
+ ## 192.168.1.100
260
+
261
+ ## 192.168.1.110
262
+
263
+
264
+
265
+ # If you have multiple hosts following a pattern you can specify
266
+
267
+ # them like this:
268
+
269
+
270
+
271
+ ## www[001:006].example.com
272
+
273
+
274
+
275
+ # Ex 3: A collection of database servers in the 'dbservers' group
276
+
277
+
278
+
279
+ ## [dbservers]
280
+
281
+ ##
282
+
283
+ ## db01.intranet.mydomain.net
284
+
285
+ ## db02.intranet.mydomain.net
286
+
287
+ ## 10.25.1.56
288
+
289
+ ## 10.25.1.57
290
+
291
+
292
+
293
+ # Here's another example of host ranges, this time there are no
294
+
295
+ # leading 0s:
296
+
297
+
298
+
299
+ ## db-[99:101]-node.example.com
300
+
301
+ ```
302
+
197
303
  他にもvagrant mount フォルダ共有ができない問題などがありましたが、そこはvagrant plugin install vagrant-vbguestで解決することができ、最後にこのエラーとずっと向き合っています。
198
304
 
199
305
  どなたか助言をいただけると助かります。

1

追記

2020/01/15 15:13

投稿

big_sky
big_sky

スコア23

test CHANGED
File without changes
test CHANGED
@@ -26,6 +26,174 @@
26
26
 
27
27
 
28
28
 
29
+ ```ここに言語を入力
30
+
31
+ playbook.yml
32
+
33
+
34
+
35
+ template: template0
36
+
37
+ owner: wardish
38
+
39
+ login_user: postgres
40
+
41
+ login_host: localhost
42
+
43
+
44
+
45
+ - name: grant all to wardishdir
46
+
47
+ postgresql_privs:
48
+
49
+ db: wardishdir
50
+
51
+ type: group
52
+
53
+ objs: wardish
54
+
55
+ roles: postgres
56
+
57
+ login_user: postgres
58
+
59
+ login_host: localhost
60
+
61
+
62
+
63
+ - name: create extensions
64
+
65
+ postgresql_ext:
66
+
67
+ db: wardishdir
68
+
69
+ login_user: postgres
70
+
71
+ login_host: localhost
72
+
73
+ name: '{{ item }}'
74
+
75
+ with_items:
76
+
77
+ - pgcrypto
78
+
79
+ - pg_trgm
80
+
81
+
82
+
83
+
84
+
85
+ ```
86
+
87
+
88
+
89
+ ```ここに言語を入力
90
+
91
+ bitbucket-pipelines.yml
92
+
93
+
94
+
95
+ - composer
96
+
97
+ deployment: production
98
+
99
+ script:
100
+
101
+ # - apt-get update
102
+
103
+ - apt install -y zip
104
+
105
+ - cd apps/codeigniter
106
+
107
+ - sed -i -e "s/<<version>>/$BITBUCKET_TAG/" application/config/app_config.php
108
+
109
+ - composer install
110
+
111
+ # - python sitevar.py > vars/site_vars.yml
112
+
113
+ - zip -r /tmp/artifact.zip .
114
+
115
+ - cd ../../
116
+
117
+ - python codedeploy_deploy.py
118
+
119
+
120
+
121
+ definitions:
122
+
123
+ services:
124
+
125
+ postgres:
126
+
127
+ image: postgres
128
+
129
+ environment:
130
+
131
+ TZ: "Asia/Tokyo"
132
+
133
+ POSTGRES_DB: wardishdir
134
+
135
+ POSTGRES_USER: wardish
136
+
137
+ DATABASE_URL: postgres://wardish@localhost:5432/wardishdir
138
+
139
+
140
+
141
+
142
+
143
+ ```
144
+
145
+
146
+
147
+ ```ここに言語を入力
148
+
149
+ Vagrantfile
150
+
151
+
152
+
153
+ # -*- mode: ruby -*-
154
+
155
+ # vi: set ft=ruby :
156
+
157
+
158
+
159
+ Vagrant.configure(2) do |config|
160
+
161
+
162
+
163
+ config.vm.provider "virtualbox" do |v|
164
+
165
+ v.name = "wardishdir"
166
+
167
+ v.memory = "2048"
168
+
169
+ end
170
+
171
+
172
+
173
+ config.vm.box = "bento/centos-7.3"
174
+
175
+
176
+
177
+ config.vm.network "private_network", ip: "192.168.33.19"
178
+
179
+
180
+
181
+ config.vm.provision :ansible_local do |ansible|
182
+
183
+ ansible.playbook = "playbook.yml"
184
+
185
+ end
186
+
187
+
188
+
189
+ end
190
+
191
+
192
+
193
+ ```
194
+
195
+
196
+
29
197
  他にもvagrant mount フォルダ共有ができない問題などがありましたが、そこはvagrant plugin install vagrant-vbguestで解決することができ、最後にこのエラーとずっと向き合っています。
30
198
 
31
199
  どなたか助言をいただけると助かります。