Gabe Black | 4c040b7 | 2016-11-17 22:35:04 +0000 | [diff] [blame] | 1 | --- |
| 2 | |
| 3 | - name: check if need to set up controller |
| 4 | command: grep "localhost.fusion-controller" /etc/hosts |
| 5 | register: result |
| 6 | ignore_errors: True |
| 7 | |
| 8 | - name: setup /etc/hosts - delete default entry |
| 9 | shell: sed -i "/localhost.fusion-controller/d" /etc/hosts |
| 10 | when: result.rc == 0 |
| 11 | |
| 12 | - name: setup /etc/hostname - set hostname |
| 13 | shell: sed -i "/localhost.fusion-controller/d" /etc/hostname |
| 14 | when: result.rc == 0 |
| 15 | |
| 16 | - name: setup /etc/hosts - delete default entry |
| 17 | shell: echo "{{ public_ip }} $(hostname)" >> /etc/hosts |
| 18 | when: result.rc == 0 |
| 19 | |
| 20 | - name: set controller ip in ui config |
| 21 | shell: | |
| 22 | python -c "import json as j;f='/ada/NTCtestui/config.json';d=j.load(open(f));d['fusion-controller']['hostname']='{{ public_ip }}';d['fusion-collector']['hostname']='{{ public_ip }}';j.dump(d,open(f,'w'))" |
| 23 | when: result.rc == 0 |
| 24 | |
| 25 | - name: start fusion services |
| 26 | shell: /etc/init.d/npiu_adatdce restart |
| 27 | when: result.rc == 0 |
| 28 | |
| 29 | |