Commit 626fd7c7 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Thomas Gambier

playbook: Add imt server statup playbook

parent f37ecd6b
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars_files:
- settings/imt.yml
roles:
- { role: imt-slapos, post_config: True }
\ No newline at end of file
--- ---
- file: path=/opt/upgrader state=directory mode=0755
- name: stat directory {{ mount_directory }} - name: stat directory {{ mount_directory }}
stat: path={{ mount_directory }} stat: path={{ mount_directory }}
...@@ -25,6 +26,20 @@ ...@@ -25,6 +26,20 @@
mount: src="{{ mount_directory }}/opt/slapos" name=/opt/slapos opts=bind state=mounted fstype=none mount: src="{{ mount_directory }}/opt/slapos" name=/opt/slapos opts=bind state=mounted fstype=none
when: mount_directory is defined and slapos_directory.stat.exists == True when: mount_directory is defined and slapos_directory.stat.exists == True
- stat: path=/opt/upgrader/playbook
register: playbook
- name: Download the playbook
shell: /usr/local/bin/slapcache-download --destination=/opt/upgrader/archive.tar.gz
when: playbook.stat.exists == False
- name: Copy slapos.playbook
unarchive: src=/opt/upgrader/archive.tar.gz dest=/opt/upgrader/playbook
when: playbook.stat.exists == False
- name: Set Startup Cron
cron: name="Launch Startup with ansible" special_time=reboot job='cd /opt/upgrader/playbook && ansible-playbook imt-startup.yml -i hosts 2>>/opt/upgrader/startup.log >> /opt/upgrader/startup.log'
- name: stat slapos.cfg file - name: stat slapos.cfg file
stat: path=/etc/opt/slapos/slapos.cfg stat: path=/etc/opt/slapos/slapos.cfg
register: slapos_cfg register: slapos_cfg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment