-
Notifications
You must be signed in to change notification settings - Fork 38
/
tower-setup.yml
59 lines (50 loc) · 1.63 KB
/
tower-setup.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
54
55
56
57
58
59
---
- hosts: localhost
connection: local
become: false
vars_files: tower-vars.yml
vars:
tower_download: false
tower_download_force: false
tasks:
- name: ensure installer directory is present
file:
path: "{{ tower_installer_dir }}"
state: directory
- name: download tower installer
get_url:
url: "{{ tower_download_url }}"
dest: "{{ tower_installer_dir }}/{{ tower_artifact }}"
mode: 0644
force: "{{ tower_download_force | bool }}"
when: tower_download
- name: ensure installer already exists
stat:
path: "{{ tower_installer_dir }}/{{ tower_artifact }}"
register: artifact_status
failed_when: not artifact_status.stat.exists
- name: extract installer
command: "tar xzf {{ tower_artifact }}"
args:
chdir: "{{ tower_installer_dir }}"
creates: "{{ playbook_dir }}/{{ tower_installer_current }}"
# issues with running unarchive module with tar vs gtar
# unarchive:
# src: "{{ tower_installer_dir }}/{{ tower_artifact }}"
# dest: "{{ tower_installer_dir }}/"
# remote_src: yes
# creates: "{{ tower_installer_current }}"
- name: tower installation block
block:
- name: ensure inventory is pointed to primary
include_role:
name: tower_inventory
vars:
tower_inventory_file: "{{ tower_inventory_pm }}"
- name: run tower installer
include_role:
name: tower_install
vars:
tower_install_inventory: "{{ ansible_inventory_sources[0] }}"
tower_install_directory: "{{ tower_installer_current }}"
tower_install_ram_override: "{{ tower_ram_override }}"