Skip to content

Commit

Permalink
fix: improved ansile-lint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangda committed Oct 12, 2022
1 parent 5dd08cf commit 538d68a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ ignore: |
.travis.yml
.ansible-lint
.yamllint
.github
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This role work on RedHat, CentOS, Amazon Linux, Debian and Ubuntu distributions
* stream8
* Rocky Linux
* 8
* 9
* Amazon Linux
* 2
* Ubuntu
Expand All @@ -52,6 +53,7 @@ This role work on RedHat, CentOS, Amazon Linux, Debian and Ubuntu distributions
* 18.*
* 20.*
* 21.*
* 22.*
* Debian
* Stretch (9)
* buster (10)
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ galaxy_info:
- bionic
- focal
- impish
- jammy

galaxy_tags:
- aws
Expand Down
13 changes: 8 additions & 5 deletions tasks/install-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
tags:
- install

- name: Install {{ cwa_dependencies_packages }} dependency on {{ansible_distribution}} 6/7/8
- name: Install {{ cwa_dependencies_packages }} dependency on {{ ansible_distribution }} 6/7/8/9
yum:
name: "{{ cwa_dependencies_packages }}"
state: present
Expand All @@ -71,6 +71,7 @@
ansible_distribution == 'RedHat' or
ansible_distribution == 'Rocky'
) and (
ansible_distribution_major_version == '9' or
ansible_distribution_major_version == '8' or
ansible_distribution_major_version == '7' or
ansible_distribution_major_version == '6'
Expand All @@ -95,7 +96,7 @@
tags:
- install

- name: Install {{ cwa_package }}.rpm on {{ansible_distribution}} 6/7
- name: Install {{ cwa_package }}.rpm on {{ ansible_distribution }} 6/7
yum:
name: "{{ cwa_temp_path }}/{{ cwa_package }}.rpm"
disable_gpg_check: true
Expand All @@ -117,7 +118,7 @@
tags:
- install

- name: Install {{ cwa_package }}.rpm on {{ansible_distribution}} 8
- name: Install {{ cwa_package }}.rpm on {{ ansible_distribution }} 8/9
dnf:
name: "{{ cwa_temp_path }}/{{ cwa_package }}.rpm"
disable_gpg_check: true
Expand All @@ -131,8 +132,10 @@
ansible_distribution == 'CentOS' or
ansible_distribution == 'RedHat' or
ansible_distribution == 'Rocky'
) and
ansible_distribution_major_version == '8'
) and (
ansible_distribution_major_version == '9' or
ansible_distribution_major_version == '8'
)
ignore_errors: "{{ ansible_check_mode }}"
tags:
- install
6 changes: 3 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ cwa_temp_path: /tmp
cwa_agent_profile_credentials_file: "{{ cwa_agent_profile_path }}/.aws/credentials"

# Conditional variables
cwa_use_proxy: "{{ true|bool if cwa_http_proxy is defined and cwa_http_proxy|length > 0 else false|bool }}"
cwa_use_conf_json_template: "{{ false|bool if cwa_conf_json_file_content is defined and cwa_conf_json_file_content|length > 0 else true|bool }}"
cwa_use_proxy: "{{ true | bool if cwa_http_proxy is defined and cwa_http_proxy | length > 0 else false | bool }}"
cwa_use_conf_json_template: "{{ false | bool if cwa_conf_json_file_content is defined and cwa_conf_json_file_content | length > 0 else true | bool }}"

# defined in defaults/main.yaml
cwa_need_credentials: "{{ true|bool if cwa_agent_mode == 'onPremise' else cwa_use_credentials }}"
cwa_need_credentials: "{{ true | bool if cwa_agent_mode == 'onPremise' else cwa_use_credentials }}"

cwa_arch_names: {
"x86_64": "amd64",
Expand Down

0 comments on commit 538d68a

Please sign in to comment.