Skip to content

Commit

Permalink
Merge pull request #43 from Tompage1994/ah_fixes
Browse files Browse the repository at this point in the history
Allow deployment of only AH
  • Loading branch information
sean-m-sullivan authored Mar 16, 2021
2 parents 353fd81 + 6e4de3c commit 8e0d1f7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
4 changes: 3 additions & 1 deletion roles/install/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# redhat_cop.tower_utilities.install

Ansible role to prep to install Ansible Tower and Ansible automation hub.
Ansible role to prep to install Ansible Tower and Ansible Automation Hub.

The role utilises the Ansible Automation Platform installer. For more information see [the Ansible Automation Platform Installation Guide](https://docs.ansible.com/ansible-tower/latest/html/installandreference/index.html).

## Requirements

Expand Down
33 changes: 29 additions & 4 deletions roles/install/tasks/tower_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,32 @@
register: tower_install_check
ignore_errors: true
failed_when: false
when: not tower_force_setup
when: tower_hosts != [] and not tower_force_setup

- name: Check Automation Hub Running
uri:
url: "{{ tower_ah_url }}/api/galaxy/"
method: GET
user: admin
password: "{{ tower_admin_password }}"
validate_certs: false
force_basic_auth: true
register: tower_ah_install_check
ignore_errors: true
failed_when: false
when: tower_ah_hosts != [] and not tower_force_setup

- block:
# Run the Setup
- name: "[Tower] Run the Ansible Tower Setup Program"
- name: "[Tower] Run the Ansible Automation Platform Setup Program"
command: ./setup.sh
args:
chdir: "{{ tower_setup_dir }}"
async: 10000
poll: 20
changed_when: false # these will always run and will always report “changed” otherwise

- name: Wait for ansible tower to be running.
- name: Wait for Ansible Tower to be running.
uri:
url: "{{ tower_url }}"
status_code: 200
Expand All @@ -31,6 +44,18 @@
until: result.status == 200
retries: 90
delay: 10
when: tower_hosts != []

- name: Wait for Automation Hub to be running.
uri:
url: "{{ tower_ah_url }}/ui/"
status_code: 200
validate_certs: false
register: result_ah
until: result_ah.status == 200
retries: 90
delay: 10
when: tower_ah_hosts != []
when:
- tower_force_setup or tower_install_check.status != 200
- tower_force_setup or (tower_hosts != [] and tower_install_check.status != 200) or (tower_ah_hosts != [] and tower_ah_install_check.status != 200)
...

0 comments on commit 8e0d1f7

Please sign in to comment.