forked from iamraj007/Ansible_AWX_install_role
-
Notifications
You must be signed in to change notification settings - Fork 0
/
awx.yaml
executable file
·61 lines (45 loc) · 1.28 KB
/
awx.yaml
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
---
- name: Create app dir
file:
path: /opt/awxapp
state: directory
- name: Clone AWX from offical repo
git:
repo: https://github.com/ansible/awx.git
dest: /opt/awxapp
register: awx_git
- debug: var=awx_git
- name: Use latest tag from AWX repo only
shell: "latesttag=$(git for-each-ref --sort=taggerdate --format '%(tag)' | tail -1); git checkout ${latesttag}; git branch | head -1"
args:
chdir: /opt/awxapp
register: git_checkout_tag
# ignore_errors: true
- debug: var=git_checkout_tag
- name: Update python version in script
shell: "head -1 inventory | sed -i 's/python3/python/g' inventory"
args:
chdir: /opt/awxapp/installer
register: py_update
ignore_errors: true
- debug: var=py_update
- name: Display inventory configs
command: ./get_inventory_config.sh
register: inventory_conf
- debug: var=inventory_conf.stdout_lines
#- name: Display inventory configs
# command: "cat inventory |grep -v "#" |grep . "
# args:
# chdir: /opt/awxapp/installer
# register: inventory_conf
#- debug: var=inventory_conf
- name: Ensure project directory exist
file:
path: "{{ item }}"
mode: '0644'
recurse: yes
with_items:
- /var/lib/awx/projects
- /var/lib/awx/projects/mylocal
register: local_project
- debug: var=local_project