-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant-playbook.yml
executable file
·92 lines (78 loc) · 2.17 KB
/
vagrant-playbook.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env ansible-playbook
---
- name: Provision RHEL8 VM
hosts: all:!localhost
become: true
gather_facts: true
tags: [provision]
pre_tasks:
- name: Use RHEL8 ISO as Yum repo
ansible.builtin.include_role:
name: dvd_repository
- name: Relax settings for install
ansible.builtin.include_role:
name: grace_period
tasks_from: present
- name: Prepare AAP deployment
hosts: aap
become: true
gather_facts: true
tags: [prepare]
pre_tasks:
- name: Setup ssh keys for install
ansible.builtin.include_role:
name: ssh_keys
- name: Deploy AAP
hosts: aap
become: true
gather_facts: true
tags: [deploy]
tasks:
- name: Install Automation Platform
ansible.builtin.include_role:
name: aap
- name: Configure Local Collections
hosts: localhost
become: false
gather_facts: false
tags: [local]
pre_tasks:
- name: Install collections
changed_when: true
# yamllint disable-line rule:line-length
ansible.builtin.command: "ansible-galaxy collection install -r collections/requirements.yml"
- name: Configure Ansible Controller post installation
hosts: localhost
connection: local
tags: [configure]
collections:
- awx.awx
- infra.controller_configuration
pre_tasks:
- name: Include vars from configs directory
ansible.builtin.include_vars:
dir: group_vars/controller
extensions: ["yml"]
no_log: true
tags:
- always
- name: Wait for API to come up
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/ping"
status_code: 200
validate_certs: "{{ controller_validate_certs }}"
register: result
until: result.status == 200
retries: 20
delay: 3
ignore_errors: true
- name: Sleep for 10 seconds and allow API to come up.
ansible.builtin.wait_for:
timeout: 10
delegate_to: localhost
- name: Update token
ansible.builtin.include_tasks: tasks/get_token.yml
- name: Remove Demo content
ansible.builtin.include_tasks: tasks/delete_demo.yml
roles:
- dispatch # The dispatch role calls all of the other roles.