-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yml
53 lines (44 loc) · 1.4 KB
/
deploy.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- hosts: all
remote_user: root
tasks:
- name: Check and Initialize
fail:
msg: 'Not supported OS: {{ansible_distribution}}'
when: ansible_distribution not in ['CentOS', 'Ubuntu', 'Debian']
- include_vars: 'vars/common.yml'
- include_vars: 'vars/{{ansible_distribution}}.yml'
- include_vars: 'extra_hosts.yml'
when: test is not defined
- include_vars: 'extra_wires.yml'
when: test is not defined
- include_vars: 'tests/extra_hosts.yml'
when: test is defined
- include_vars: 'tests/extra_wires.yml'
when: test is defined
- name: Check Installed Mobula
stat:
path: '{{install_dir}}'
register: install_result
- name: Get External Interface
set_fact:
ext_net: '{{ansible_default_ipv4}}'
when: not install_result.stat.exists
- name: Fetch External Interface
shell: 'cat {{etc_dir}}/extif.json'
register: 'extif_json_result'
when: install_result.stat.exists
- name: Load External Interface
set_fact:
ext_net: '{{extif_json_result.stdout | from_json}}'
when: install_result.stat.exists
- name: Deploy Files
include_role:
name: deploy_files
- name: Install
include_role:
name: install
when: not install_result.stat.exists or reinstall is defined
- name: Configure
include_role:
name: configure