Skip to content

Commit

Permalink
Merge pull request #82 from branic/update_ansible-lint_version
Browse files Browse the repository at this point in the history
Update ansible-lint version
  • Loading branch information
sean-m-sullivan authored Jul 7, 2022
2 parents e4407ed + 7f24ae4 commit 5814e28
Show file tree
Hide file tree
Showing 26 changed files with 76 additions and 75 deletions.
4 changes: 1 addition & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use_default_rules: true
# https://github.com/ansible/ansible-lint/issues/808
# with verbosity set to 1, its dumping 'unknown file type messages'
# verbosity: 1
skip_list:
# Temporarily disabling the ignore-errors check to get CI to pass
- ignore-errors
skip_list: []
# Disabled the the below skip_list as they use the old style rule names.
# With the move of the .yamllint.yml to TLD ansible-lint now picks up our config so no need to exclude it.
# # [E204]: "Lines should be no longer than 160 chars"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
# entry: "yamllint"
# types: [yaml]
- repo: https://github.com/ansible/ansible-lint.git
rev: v5.3.2
rev: v6.3.0
hooks:
# see discussions here about what arguments are used, and behavior
# https://github.com/ansible/ansible-lint/issues/649
Expand Down
3 changes: 2 additions & 1 deletion galaxy.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ tags:
- tower
- tower_utilities
- tower_utils
dependencies: {}
dependencies:
"ansible.posix": ">=1.0.0"
4 changes: 2 additions & 2 deletions roles/aap_backup/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ galaxy_info:

license: MIT

min_ansible_version: 2.12
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"

galaxy_tags:
- linux
Expand Down
2 changes: 1 addition & 1 deletion roles/aap_backup/tasks/backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Run the Setup to backup tower
- name: "[Tower] Run the Ansible Tower Setup Program with backup option"
become: true
command: ./setup.sh -e 'backup_dest={{ aap_backup_dest | quote }}' -b
ansible.builtin.command: ./setup.sh -e 'backup_dest={{ aap_backup_dest | quote }}' -b
args:
chdir: "{{ aap_setup_prep_setup_dir }}"
async: 10000
Expand Down
2 changes: 1 addition & 1 deletion roles/aap_certs/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: restart Nginx service
become: true
service:
ansible.builtin.service:
name: nginx
state: restarted
listen: restart_aap_service
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_certs/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ galaxy_info:

license: MIT

min_ansible_version: 2.12
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"

galaxy_tags:
- linux
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_certs/tasks/autohub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# according to https://access.redhat.com/solutions/5731261
- name: autohub | copy cert into place
become: true
copy:
ansible.builtin.copy:
src: "{{ aap_certs_autohub_ssl_cert | default(omit) }}"
content: "{{ aap_certs_autohub_ssl_cert_content | default(omit) }}"
dest: "{{ aap_certs_autohub_cert_dest }}"
Expand All @@ -15,7 +15,7 @@

- name: autohub | copy key into place
become: true
copy:
ansible.builtin.copy:
src: "{{ aap_certs_autohub_ssl_key | default(omit) }}"
content: "{{ aap_certs_autohub_ssl_key_content | default(omit) }}"
dest: "{{ aap_certs_autohub_key_dest }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_certs/tasks/controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# according to https://access.redhat.com/solutions/3109871
- name: controller | copy cert into place
become: true
copy:
ansible.builtin.copy:
src: "{{ aap_certs_controller_ssl_cert | default(omit) }}"
content: "{{ aap_certs_controller_ssl_cert_content | default(omit) }}"
dest: "{{ aap_certs_controller_cert_dest }}"
Expand All @@ -14,7 +14,7 @@

- name: controller | copy key into place
become: true
copy:
ansible.builtin.copy:
src: "{{ aap_certs_controller_ssl_key | default(omit) }}"
content: "{{ aap_certs_controller_ssl_key_content | default(omit) }}"
dest: "{{ aap_certs_controller_key_dest }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_remove/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ galaxy_info:

license: MIT

min_ansible_version: 2.12
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"

galaxy_tags:
- linux
Expand Down
12 changes: 6 additions & 6 deletions roles/aap_remove/tasks/ah_remove.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Stop and disable services
systemd:
ansible.builtin.systemd:
name: "{{ item }}"
state: stopped
enabled: false
ignore_errors: true
failed_when: false
loop:
- nginx.service
- postgresql.service
Expand All @@ -16,7 +16,7 @@
become: true

- name: Remove software
yum:
ansible.builtin.yum:
name:
- postgresql
- postgresql-server
Expand All @@ -36,7 +36,7 @@
become: true

- name: Remove created directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
Expand All @@ -47,7 +47,7 @@
become: true

- name: Remove added users
user:
ansible.builtin.user:
name: "{{ item }}"
state: absent
remove: true
Expand All @@ -59,7 +59,7 @@
become: true

- name: Remove added groups
group:
ansible.builtin.group:
name: "{{ item }}"
state: absent
loop:
Expand Down
12 changes: 6 additions & 6 deletions roles/aap_remove/tasks/controller_remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Following this article: https://access.redhat.com/solutions/6733721

- name: Stop and disable services
systemd:
ansible.builtin.systemd:
name: "{{ item }}"
state: stopped
enabled: false
become: true
ignore_errors: true
failed_when: false
loop:
- automation-controller.service
- postgresql.service
Expand All @@ -17,7 +17,7 @@
- receptor.service

- name: Remove software
yum:
ansible.builtin.yum:
name:
- postgresql
- postgresql-server
Expand All @@ -31,7 +31,7 @@
become: true

- name: Remove created directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
Expand All @@ -44,7 +44,7 @@
become: true

- name: Remove added users
user:
ansible.builtin.user:
name: "{{ item }}"
state: absent
remove: true
Expand All @@ -57,7 +57,7 @@
become: true

- name: Remove added groups
group:
ansible.builtin.group:
name: "{{ item }}"
state: absent
loop:
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_restore/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ galaxy_info:

license: MIT

min_ansible_version: 2.12
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"

galaxy_tags:
- linux
Expand Down
2 changes: 1 addition & 1 deletion roles/aap_restore/tasks/restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Run the Setup to restore tower
- name: "[Tower] Run the Ansible Tower Setup Program with restore option"
become: true
command: ./setup.sh -e 'restore_backup_file={{ aap_restore_location | quote }}' -r
ansible.builtin.command: ./setup.sh -e 'restore_backup_file={{ aap_restore_location | quote }}' -r
args:
chdir: "{{ aap_setup_prep_setup_dir }}"
async: 10000
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_setup_download/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ galaxy_info:

license: MIT

min_ansible_version: 2.9
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"

galaxy_tags: ['aap', 'ansible']

Expand Down
11 changes: 6 additions & 5 deletions roles/aap_setup_download/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# tasks file for aap_setup_download
- name: Login to Red Hat APIs
uri:
ansible.builtin.uri:
url: "{{ aap_setup_down_token_url }}"
method: POST
body_format: form-urlencoded
Expand All @@ -12,7 +12,7 @@
register: __aap_setup_down_login

- name: collecting the available installers
uri:
ansible.builtin.uri:
url: "{{ aap_setup_down_images_url }}"
method: GET
return_content: true
Expand All @@ -21,20 +21,21 @@
register: __aap_setup_down_output

- name: simplify the list of possible downloads
set_fact:
ansible.builtin.set_fact:
__aap_setup_down_images: "{{ __aap_setup_down_output.json.body | sort(attribute='datePublished', reverse=True) }}"

- name: downloading the latest installer of type {{ aap_setup_down_type }}
get_url:
ansible.builtin.get_url:
url: "{{ item.downloadHref }}"
dest: "{{ aap_setup_down_dest_dir }}/{{ item.filename }}"
mode: 0644
headers:
Authorization: "Bearer {{ __aap_setup_down_login.json.access_token }}"
loop: "{{ __aap_setup_down_images[:2] }}"
when: (aap_setup_down_type + '-' + aap_setup_down_version) in item.filename
register: __aap_setup_down_downloads

- name: extract the name of the downloaded installer to aap_setup_down_installer_file
set_fact:
ansible.builtin.set_fact:
aap_setup_down_installer_file: "{{ (__aap_setup_down_downloads.results | selectattr('dest', 'defined') | map(attribute='dest') | list)[0] }}"
...
4 changes: 2 additions & 2 deletions roles/aap_setup_install/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ galaxy_info:

license: MIT

min_ansible_version: 2.9
min_ansible_version: "2.12"

platforms:
- name: Fedora
versions:
- all
- 25
- "25"

galaxy_tags: ['aap', 'ansible']

Expand Down
13 changes: 7 additions & 6 deletions roles/aap_setup_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
loop: "{{ aap_setup_inst_fixes }}"

- name: Check Ansible Tower Running
uri:
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/"
method: GET
user: admin
Expand All @@ -22,7 +22,7 @@
- not aap_setup_inst_force | bool

- name: Check Automation Hub Running
uri:
ansible.builtin.uri:
url: "https://{{ ah_hostname }}/api/galaxy/"
method: GET
user: admin
Expand All @@ -36,9 +36,10 @@
- "'automationhub' in aap_setup_prep_inv_nodes"
- not aap_setup_inst_force | bool

- block:
- name: Install AAP
block:
- name: run the Ansible Automation Platform setup program
command: "{{ lookup('template', 'setup_sh.j2') }}"
ansible.builtin.command: "{{ lookup('template', 'setup_sh.j2') }}"
args:
chdir: "{{ aap_setup_inst_setup_dir }}"
async: 10000
Expand All @@ -47,7 +48,7 @@
# these will always run and will always report “changed” otherwise

- name: wait for automation controller to be running
uri: # use the first host from the list if no hostname is defined
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: "https://{{ controller_hostname }}/"
status_code: 200
validate_certs: "{{ controller_validate_certs | default(omit) }}"
Expand All @@ -58,7 +59,7 @@
when: "'automationcontroller' in aap_setup_prep_inv_nodes"

- name: wait for automation hub to be running
uri: # use the first host from the list if no hostname is defined
ansible.builtin.uri: # use the first host from the list if no hostname is defined
url: "https://{{ ah_hostname }}/api/galaxy/"
status_code: 200
validate_certs: "{{ ah_validate_certs | default(omit) }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/aap_setup_prepare/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ galaxy_info:

license: MIT

min_ansible_version: 2.9
min_ansible_version: "2.12"

platforms:
- name: Fedora
versions:
- all
- 25
- "25"

galaxy_tags: ['aap', 'ansible']

Expand Down
2 changes: 1 addition & 1 deletion roles/aap_setup_prepare/tasks/fixes/aap_1413.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# `pulp.pulp_installer.pulp_webserver : Symlink nginx snippets`.

- name: AAP-1413 | fix pulp/pulp_installer/roles/pulp_webserver/tasks/nginx.yml
lineinfile:
ansible.builtin.lineinfile:
path: "{{ aap_setup_prep_setup_dir }}/collections/ansible_collections/pulp/pulp_installer/roles/pulp_webserver/tasks/nginx.yml"
line: ' src: "{{ __aap_setup_prep_snippet_fix }}"'
regex: '^ *src: ".. __pulp_webserver_snippet.stdout'
Expand Down
Loading

0 comments on commit 5814e28

Please sign in to comment.