From 42a15959db28e1bf6b51e3982952094ec97dff70 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 12 Mar 2020 12:59:54 +0100 Subject: [PATCH] Ansible lint cleanups --- playbooks/runcible.yml | 10 +++++----- roles/fips/tasks/main.yml | 4 ++-- roles/plugins/foreman_openscap/seed/tasks/main.yml | 8 ++++---- roles/pulp_repositories/tasks/main.yml | 4 ++-- .../puppet_repositories/tasks/puppetlabs-5-debian.yml | 4 ++-- .../tasks/puppetlabs-nightly-debian.yml | 2 +- roles/pytest_project/tasks/local_env.yml | 8 ++++---- roles/robottelo/tasks/main.yml | 2 +- roles/unpriviledged_user/tasks/main.yml | 3 ++- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/playbooks/runcible.yml b/playbooks/runcible.yml index 25ddfc97e..b9bc5f7e4 100644 --- a/playbooks/runcible.yml +++ b/playbooks/runcible.yml @@ -36,10 +36,10 @@ become: true - name: "Install RVM gpg key" - shell: "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3" + command: "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3" - name: "Install RVM" - shell: "curl -sSL https://get.rvm.io | bash -s stable --ruby" + command: "curl -sSL https://get.rvm.io | bash -s stable --ruby" - name: "Install librarian-puppet" gem: @@ -57,7 +57,7 @@ dest: "/home/vagrant/puppet-pulp/Puppetfile" - name: "Install Puppet modules" - shell: "/home/vagrant/bin/librarian-puppet install" + command: "/home/vagrant/bin/librarian-puppet install" args: chdir: "/home/vagrant/puppet-pulp" remote_user: "vagrant" @@ -83,7 +83,7 @@ - name: "Run puppet apply" become: true - shell: "/opt/puppetlabs/bin/puppet apply --modulepath=/home/vagrant/puppet-pulp/modules /home/vagrant/test.pp" + command: "/opt/puppetlabs/bin/puppet apply --modulepath=/home/vagrant/puppet-pulp/modules /home/vagrant/test.pp" - name: "Open up permissions on server.conf" become: true @@ -106,6 +106,6 @@ chdir: "/home/vagrant/runcible" - name: "Run tests" - shell: "rake test mode=all" + command: "rake test mode=all" args: chdir: "/home/vagrant/runcible" diff --git a/roles/fips/tasks/main.yml b/roles/fips/tasks/main.yml index 5b738c03a..a9c685875 100644 --- a/roles/fips/tasks/main.yml +++ b/roles/fips/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: 'Install dracut-fips' - package: + package: name: dracut-fips state: present @@ -21,7 +21,7 @@ ignore_errors: true - name: Waiting for reboot - local_action: wait_for + local_action: wait_for host={{ ansible_ssh_host }} state=started diff --git a/roles/plugins/foreman_openscap/seed/tasks/main.yml b/roles/plugins/foreman_openscap/seed/tasks/main.yml index 6e832dab9..751ff3e0a 100644 --- a/roles/plugins/foreman_openscap/seed/tasks/main.yml +++ b/roles/plugins/foreman_openscap/seed/tasks/main.yml @@ -1,13 +1,13 @@ --- - name: 'Import puppet classes' - shell: > + command: > {{ foreman_openscap_hammer }} proxy import-classes --name {{ foreman_openscap_proxy_name }} - when: '{{ foreman_openscap_proxy_name != False }}' + when: foreman_openscap_proxy_name != False - name: 'Import default scap content' - shell: > + command: > foreman-rake foreman_openscap:bulk_upload:default - when: '{{ foreman_openscap_proxy_name != False }}' + when: foreman_openscap_proxy_name != False # TODO: disabled until cli is fixed # - name: 'Create example policy' diff --git a/roles/pulp_repositories/tasks/main.yml b/roles/pulp_repositories/tasks/main.yml index 48d68d323..6e271c1a2 100644 --- a/roles/pulp_repositories/tasks/main.yml +++ b/roles/pulp_repositories/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Add Pulp {{ pulp_repositories_version }} stable repository +- name: "Add Pulp {{ pulp_repositories_version }} stable repository" yum_repository: name: pulp-repository description: Pulp release repository @@ -23,6 +23,6 @@ yum_repository: name: jortel-gofer description: Copr repo for gofer owned by jortel - baseurl: https://copr-be.cloud.fedoraproject.org/results/jortel/gofer/epel-{{ ansible_distribution_major_version }}-x86_64/ + baseurl: "https://copr-be.cloud.fedoraproject.org/results/jortel/gofer/epel-{{ ansible_distribution_major_version }}-x86_64/" gpgcheck: 1 gpgkey: https://copr-be.cloud.fedoraproject.org/results/jortel/gofer/pubkey.gpg diff --git a/roles/puppet_repositories/tasks/puppetlabs-5-debian.yml b/roles/puppet_repositories/tasks/puppetlabs-5-debian.yml index 25deb85f6..ecdfbaf7a 100644 --- a/roles/puppet_repositories/tasks/puppetlabs-5-debian.yml +++ b/roles/puppet_repositories/tasks/puppetlabs-5-debian.yml @@ -5,7 +5,7 @@ - name: 'Install Puppet 5 repository' apt_repository: - repo: deb http://apt.puppet.com {{ ansible_distribution_release }} puppet5 + repo: "deb http://apt.puppet.com {{ ansible_distribution_release }} puppet5" state: present - name: 'Install backports' @@ -17,5 +17,5 @@ apt: name: 'openjdk-8-jre-headless' state: present - default_release: "{{ansible_distribution_release}}-backports" + default_release: "{{ ansible_distribution_release }}-backports" when: ansible_distribution_release == "jessie" diff --git a/roles/puppet_repositories/tasks/puppetlabs-nightly-debian.yml b/roles/puppet_repositories/tasks/puppetlabs-nightly-debian.yml index c0e69a1a8..b4dc84e17 100644 --- a/roles/puppet_repositories/tasks/puppetlabs-nightly-debian.yml +++ b/roles/puppet_repositories/tasks/puppetlabs-nightly-debian.yml @@ -25,5 +25,5 @@ apt: name: 'openjdk-8-jre-headless' state: present - default_release: "{{ansible_distribution_release}}-backports" + default_release: "{{ ansible_distribution_release }}-backports" when: ansible_distribution_release == "jessie" diff --git a/roles/pytest_project/tasks/local_env.yml b/roles/pytest_project/tasks/local_env.yml index bb8ae568e..a1566d176 100644 --- a/roles/pytest_project/tasks/local_env.yml +++ b/roles/pytest_project/tasks/local_env.yml @@ -1,8 +1,8 @@ - name: "Create alias for testing command" - lineinfile: - dest: ~/.bash_profile + lineinfile: + dest: ~/.bash_profile line: "alias {{ pytest_project_alias }}=\"{{ pytest_project_command }}\"" - when: pytest_project_alias != "" + when: pytest_project_alias - debug: msg: | @@ -11,4 +11,4 @@ - debug: msg: "The testing command is aliased as {{ pytest_project_alias }}" - when: pytest_project_alias != "" + when: pytest_project_alias diff --git a/roles/robottelo/tasks/main.yml b/roles/robottelo/tasks/main.yml index 3cf281fcf..69a2b33c6 100644 --- a/roles/robottelo/tasks/main.yml +++ b/roles/robottelo/tasks/main.yml @@ -14,7 +14,7 @@ - include_tasks: ssh.yml - name: robottelo properties file - shell: cp robottelo.properties.sample robottelo.properties + command: cp robottelo.properties.sample robottelo.properties args: chdir: "{{ robottelo_directory }}" diff --git a/roles/unpriviledged_user/tasks/main.yml b/roles/unpriviledged_user/tasks/main.yml index 868db5ca4..1a18b17aa 100644 --- a/roles/unpriviledged_user/tasks/main.yml +++ b/roles/unpriviledged_user/tasks/main.yml @@ -24,7 +24,8 @@ mode: 0700 become: true -- lineinfile: +- name: "Ensure public key is in authorized_keys" + lineinfile: line: "{{ lookup('file', unpriviledged_user_import_ssh_pub_key) }}" path: "/home/{{ unpriviledged_user_username }}/.ssh/authorized_keys" create: yes