| --- |
| |
| - name: check if need to set up controller |
| command: grep "localhost.fusion-controller" /etc/hosts |
| register: result |
| ignore_errors: True |
| |
| - name: setup /etc/hosts - delete default entry |
| shell: sed -i "/localhost.fusion-controller/d" /etc/hosts |
| when: result.rc == 0 |
| |
| - name: setup /etc/hostname - set hostname |
| shell: sed -i "/localhost.fusion-controller/d" /etc/hostname |
| when: result.rc == 0 |
| |
| - name: setup /etc/hosts - delete default entry |
| shell: echo "{{ public_ip }} $(hostname)" >> /etc/hosts |
| when: result.rc == 0 |
| |
| - name: set controller ip in ui config |
| shell: | |
| 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'))" |
| when: result.rc == 0 |
| |
| - name: start fusion services |
| shell: /etc/init.d/npiu_adatdce restart |
| when: result.rc == 0 |
| |
| |