Skip to content

Commit

Permalink
make ansible-lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jul 8, 2020
1 parent a9d1815 commit 498ce27
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion roles/fips/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
command: 'findmnt -no uuid /boot'
register: result

- name: 'Edit kernel command-line to include the fips=1 and boot=UUID=XXXX or boot=LABEL=XXXX or boot=/dev/DEVICE argument'
- name: 'Edit kernel command-line to include the fips=1 and boot=UUID=XXXX argument'
shell: 'grubby --update-kernel=DEFAULT --args="fips=1 boot=UUID={{ result.stdout }}"'

- name: reboot vm
Expand Down
2 changes: 1 addition & 1 deletion roles/foreman_devel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
when: foreman_devel_github_push_ssh

- name: setup reviewing script
include_role:
include_role:
name: reviewer
3 changes: 2 additions & 1 deletion roles/foreman_installer/tasks/installer_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
src: /usr/share/foreman-installer/VERSION
register: foreman_installer_version_file

- debug:
- name: 'Print installer version'
debug:
msg: "Foreman installer version {{ foreman_installer_version_file['content'] | b64decode }}"
11 changes: 7 additions & 4 deletions roles/foreman_installer/tasks/module_pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- set_fact:
- name: set namespace, module_name and ref facts
set_fact:
namespace: "{{ module.split('/')[0] }}"
module_name: "{{ module.split('/')[1] | replace('puppet-', '') | replace('puppetlabs-', '') }}"
ref: "{{ module.split('/')[2] }}"
Expand All @@ -18,11 +19,13 @@
file_type: directory
register: katello_module

- set_fact:
- name: define module_dir for foreman
set_fact:
module_dir: /usr/share/foreman-installer/modules
when: foreman_module.matched > 0

- set_fact:
- name: define module_dir for katello
set_fact:
module_dir: /usr/share/katello-installer-base/modules
when: katello_module.matched > 0

Expand All @@ -36,7 +39,7 @@
repo: https://github.com/{{ namespace }}/puppet-{{ module_name }}.git
dest: "{{ module_dir }}/{{ module_name }}"

- name:
- name: "fetch git PR"
shell: >
git fetch origin pull/{{ ref }}/head:pr &&
git {{ foreman_installer_module_prs_strategy }} pr
Expand Down
3 changes: 2 additions & 1 deletion roles/foreman_installer/tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

- include_tasks: installer_version.yml

- set_fact:
- name: 'Set internal installer options'
set_fact:
foreman_installer_options_internal_use_only: "{{ [ '--upgrade', '--certs-update-all' ] + foreman_installer_options_internal_use_only }}"
when:
- foreman_installer_version_file['content'] | b64decode is version('2.1', '<')
Expand Down
3 changes: 2 additions & 1 deletion roles/forklift/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
msg: 'Invalid value for the forklift_state variable. Please use pass "-e "forklift_state=up"" to spin up the boxes or "-e "forklift_state=destroy"" to destroy the boxes. The rebuild state can be used to first destroy and the up.'
when: forklift_state not in ('up', 'destroy', 'rebuild')

- set_fact:
- name: 'Define forklift_directory'
set_fact:
forklift_directory: "{{ lookup('env', 'PWD') }}"

- name: 'vagrant {{ forklift_state }} boxes'
Expand Down
3 changes: 2 additions & 1 deletion roles/katello_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- name: "Set up {{ katello_repositories_environment }} repositories"
include_tasks: "{{ katello_repositories_environment }}_repos.yml"

- command: dnf module -y enable pki-core
- name: enable pki-core module
command: dnf module -y enable pki-core
when: ansible_distribution_major_version == "8"

# Required for el6 clients
Expand Down
6 changes: 4 additions & 2 deletions roles/pytest_project/tasks/local_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
line: "alias {{ pytest_project_alias }}=\"{{ pytest_project_command }}\""
when: pytest_project_alias

- debug:
- name: "Print pytest command"
debug:
msg: |
pytest is installed and testing can be run with
{{ pytest_project_command }}
- debug:
- name: "Print project alias"
debug:
msg: "The testing command is aliased as {{ pytest_project_alias }}"
when: pytest_project_alias
3 changes: 2 additions & 1 deletion roles/selinux/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- when: ansible_os_family == 'RedHat'
block:
- set_fact:
- name: 'Define selinux_packages for EL7'
set_fact:
selinux_packages: ['libselinux-python', 'libsemanage-python']
when: ansible_distribution_major_version == '7'

Expand Down
3 changes: 2 additions & 1 deletion rules/TaskManyArgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class TaskManyArgs(AnsibleLintRule):
tags = ['task']

def match(self, file, text):
if text.lstrip().startswith('command:'):
text = text.lstrip()
if text.startswith('command:') or text.startswith('name:') or 'lookup(' in text:
return False

count = len([part for part in text.split(" ") if "=" in part])
Expand Down

0 comments on commit 498ce27

Please sign in to comment.