File tree Expand file tree Collapse file tree 8 files changed +13
-5
lines changed Expand file tree Collapse file tree 8 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 107107 <service id =" postgresql" host =" {{ item }}"
108108 start =" service postgresql start > ; /dev/null 2> ; /dev/null"
109109 stop =" service postgresql stop > ; /dev/null 2> ; /dev/nul"
110- status =" service postgresql status > ; /dev/null" >
110+ status =" service postgresql status > ; /dev/null 2 & gt ; /dev/nul " >
111111 </service >
112112{% endfor %}
113113
Original file line number Diff line number Diff line change 4343
4444- name : init secondary instance
4545 command : sudo -Hu hdfs hdfs namenode -bootstrapStandby
46- when : ansible_hostname != groups['namenodes'][0]
46+ when : ansible_hostname != groups['namenodes'][0] and destroy_data
4747
4848- name : start secondary namenode
4949 tags : service
Original file line number Diff line number Diff line change 2121- name : configure hdfs directories
2222 command : sudo -Hu hdfs hdfs dfs {{ item }}
2323 with_items :
24- - -mkdir /tmp
24+ - -mkdir -p /tmp
2525 - -chmod 1777 /tmp
2626 - -mkdir -p /user/history
2727 - -chmod 1777 /user/history
Original file line number Diff line number Diff line change 4545
4646- name : create metastore database
4747 command : psql -h {{ groups['postgresql'][0] }} --username postgres -f /tmp/ahive.sql chdir=/usr/lib/hive/scripts/metastore/upgrade/postgres
48+ when : destroy_data
4849
4950- name : remove sql and .pgpass files
5051 command : rm -f /tmp/ahive.sql /root/.pgpass
Original file line number Diff line number Diff line change 4848
4949- name : create database
5050 command : psql -h {{ groups['postgresql'][0] }} --username postgres -f /tmp/hue.sql
51+ when : destroy_data
52+ run_once : true
5153
5254- name : remove sql and .pgpass files
5355 command : rm -f /tmp/hue.sql /root/.pgpass
5961 - /usr/lib/hue/build/env/bin/hue syncdb --noinput
6062 - /usr/lib/hue/build/env/bin/hue migrate
6163 - rm -rf logs
64+ when : destroy_data
65+ run_once : true
6266
6367- name : start services
6468 tags : service
Original file line number Diff line number Diff line change 8484
8585- name : initialize database
8686 command : service oozie init
87+ when : destroy_data
88+ run_once : true
8789
8890- name : start services
8991 tags : service
Original file line number Diff line number Diff line change 2424
2525- name : set postgres password
2626 command : sudo -Hu postgres psql -c "alter user postgres with password '{{ postgres_password }}';"
27+ when : destroy_data
2728
2829- name : install userdb sql
2930 template : src=userdb.sql.j2 dest=/tmp/userdb.sql
3031 when : user_database is defined
3132
3233- name : create userdb
3334 command : sudo -Hu postgres psql -f /tmp/userdb.sql
34- when : user_database is defined
35+ when : user_database is defined and destroy_data
3536
3637- name : remove userdb sql
3738 command : rm -f /tmp/userdb.sql
Original file line number Diff line number Diff line change 3333- name : create hdfs directories
3434 command : sudo -Hu hdfs hdfs dfs {{ item }}
3535 with_items :
36- - -mkdir /solr
36+ - -mkdir -p /solr
3737 - -chown solr /solr
3838 run_once : true
3939
You can’t perform that action at this time.
0 commit comments