Skip to content

Commit

Permalink
Update process (#28)
Browse files Browse the repository at this point in the history
Make it possible to run playbook as non-root (in case pre-requisites are already installed)
  • Loading branch information
sean-m-sullivan authored Jan 14, 2021
1 parent a595273 commit 8d7519f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions roles/pre_tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Available variables are listed below, along with default values defined (see def
```yaml
tower_working_location: "/root/"

# Use the default tower installation template
pre_tasks_process_template: true

# Tower variables
tower_admin_password: "password"

Expand Down
14 changes: 13 additions & 1 deletion roles/pre_tasks/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
---

# Install absolutely necessary packages

- name: Check if the absolutely necessary packages are installed
raw: "rpm -q {{ __towerutils_check_packages | join(' ') }}" # noqa 303
register: __towerutils_type_packages
ignore_errors: yes
changed_when: false

- name: "Install absolutely necessary packages"
yum:
name: "{{ tower_pre_tasks_packages }}"
name: "{{ package_item }}"
state: present
loop: "{{ __towerutils_check_packages }}"
loop_control:
loop_var: package_item
when:
- ('package ' + package_item + ' is not installed') in __towerutils_type_packages.stdout

# Assert tower version specified
- name: "Assert tower version specified"
Expand Down
2 changes: 1 addition & 1 deletion roles/pre_tasks/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

# list of absolutely required RPM packages
tower_pre_tasks_packages:
__towerutils_check_packages:
- unzip # required by unarchive module, not present on a minimal/core RHEL
- tar # required by unarchive module, not present on a minimal/core RHEL

0 comments on commit 8d7519f

Please sign in to comment.