-
Notifications
You must be signed in to change notification settings - Fork 13
/
son-cmud.yml
40 lines (33 loc) · 1.22 KB
/
son-cmud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
- name: SONATA CMUD v3.1
hosts: localhost
become: false
connection: local
vars:
distro: '{{ ansible_distribution_release }}'
pre_tasks:
- debug: msg="##### START-DEPLOYMENT {{ lookup('pipe', 'date +%Y%m%d-%H:%M:%S') }}"
- file:
path: "{{ lookup('env','HOME') }}/ansible.log"
state: touch
owner: "{{ lookup('env','USER') }}"
group: "{{ lookup('env','USER') }}"
mode: "u=rw,g=rw,o=rw"
- file:
path: "{{ lookup('env','PWD') }}/group_vars/{{ plat }}/hosts"
state: absent
when: ops == "create"
# STEP 1 - PREPARE THE LOCAL MACHINE, aka Ansible Control Center (or jump host)
roles:
- { role: ntp, become: true }
- { role: common, become: true }
- { role: openstackclients, become: true }
# STEP 2 - DEPLOY A NEW INSTANCE
- { role: vm, when: ops == "create" }
# STEP 3 - DO PACKAGE UPGRADE & TOOLS INSTALLATION TO THE REMOTE MACHINE
- import_playbook: "{{ lookup('env','PWD') }}/utils/deploy/common.yml"
# STEP 4 - DEPLOY SPECIFIC SOFTWARE
- import_playbook: "{{ lookup('env','PWD') }}/{{ ops }}/{{ plat }}/main.yml"
when: plat != 'vm'
# post_tasks:
# - debug: msg="##### END-DEPLOYMENT {{ lookup('pipe', 'date +%Y%m%d-%H:%M:%S') }}"