Enable linter test for ANSIBLE0013

Use shell only shell functionality is required.
The shell functionality should only be used when piping, redirecting or
chaining commands.

Change-Id: Icb9b1dd5ea22a2af895a87a9fa2cc1b9a488ac0c
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
Chuck Short 2018-08-02 13:37:26 -04:00
parent cf24a5aa48
commit 959bed59a5
21 changed files with 24 additions and 24 deletions

View File

@ -112,5 +112,5 @@
- name: Install keystone selinux policy
become: true
shell: semodule -i /root/my-keystone.pp
command: semodule -i /root/my-keystone.pp
when: "'{{ token_provider }}' == 'fernet'"

View File

@ -4,7 +4,7 @@
#
- name: Check Ceph cluster health status
shell: ceph status
command: ceph status
register: ceph_status
failed_when: "'HEALTH_OK' not in '{{ ceph_status.stdout }}'"
changed_when: false

View File

@ -3,7 +3,7 @@
# Tests common to Director/Controller/Compute/Ceph
#
- name: Ensure crudini
shell: which crudini
command: which crudini
changed_when: no
register: crudini
ignore_errors: True

View File

@ -4,7 +4,7 @@
#
- name: Get httpd configuration files
shell: 'ls /etc/httpd/conf.d/'
command: 'ls /etc/httpd/conf.d/'
register: httpd_confd_files
- name: Gnocchi API httpd process count

View File

@ -9,7 +9,7 @@
- name: Parse Ceilometer config
become: true
shell: python /tmp/openstack-config-parser.py ceilometer /tmp/out.yml
command: python /tmp/openstack-config-parser.py ceilometer /tmp/out.yml
when: ceilometer_config.stat.exists
- name: Fetch output

View File

@ -9,7 +9,7 @@
- name: Parse Cinder config
become: true
shell: python /tmp/openstack-config-parser.py cinder /tmp/out.yml
command: python /tmp/openstack-config-parser.py cinder /tmp/out.yml
when: cinder_config.stat.exists
- name: Fetch output

View File

@ -11,7 +11,7 @@
openstack_ovs_version: "{{ ovs_version.stdout }}"
- name: Get neutron ovs agent ovsdb setting
shell: crudini --get /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs ovsdb_interface
command: crudini --get /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs ovsdb_interface
register: ovsdb_status
ignore_errors: true

View File

@ -3,4 +3,4 @@
template: src=dump_facts.j2 dest={{ browbeat_path }}/metadata/machine_facts.json
- name: Generate metadata jsons
shell : python {{ browbeat_path }}/browbeat/metadata.py {{ browbeat_path }}/metadata
command: python {{ browbeat_path }}/browbeat/metadata.py {{ browbeat_path }}/metadata

View File

@ -5,7 +5,7 @@
- name: Parse Glance config files
become: true
shell: "python /tmp/openstack-config-parser.py glance /tmp/out.yml"
command: "python /tmp/openstack-config-parser.py glance /tmp/out.yml"
- name: Fetch output
fetch: "src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes"

View File

@ -10,7 +10,7 @@
- name: Parse Gnocchi config
become: true
shell: python /tmp/openstack-config-parser.py gnocchi /tmp/out.yml
command: python /tmp/openstack-config-parser.py gnocchi /tmp/out.yml
when: gnocchi_config.stat.exists
- name: Fetch output

View File

@ -10,7 +10,7 @@
- name: Parse Heat config
become: true
shell: python /tmp/openstack-config-parser.py heat /tmp/out.yml
command: python /tmp/openstack-config-parser.py heat /tmp/out.yml
when: heat_config.stat.exists
- name: Fetch output

View File

@ -10,7 +10,7 @@
- name: Parse Keystone config
become: true
shell: python /tmp/openstack-config-parser.py keystone /tmp/out.yml
command: python /tmp/openstack-config-parser.py keystone /tmp/out.yml
when: keystone_config.stat.exists
- name: Fetch output

View File

@ -10,7 +10,7 @@
- name: Parse Neutron config
become: true
shell: python /tmp/openstack-config-parser.py neutron /tmp/out.yml
command: python /tmp/openstack-config-parser.py neutron /tmp/out.yml
when: neutron_config.stat.exists
- name: Fetch output

View File

@ -10,7 +10,7 @@
- name: Parse Nova config
become: true
shell: python /tmp/openstack-config-parser.py nova /tmp/out.yml
command: python /tmp/openstack-config-parser.py nova /tmp/out.yml
when: nova_config.stat.exists
- name: Fetch output

View File

@ -11,7 +11,7 @@
- name: Undercloud.conf
become: true
shell: python /tmp/openstack-config-parser.py undercloud /tmp/out.yml
command: python /tmp/openstack-config-parser.py undercloud /tmp/out.yml
when: undercloud_conf.stat.exists
- name: Fetch output

View File

@ -49,7 +49,7 @@
# https://github.com/ansible/ansible-modules-extras/pull/2694
# This is not in upstream Ansible releases as of 2.1.1.0
- name: Allow httpd to listen to port ({{browbeat_results_port}})
shell: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{browbeat_results_port}}"
command: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{browbeat_results_port}}"
become: true
register: seport_modified
when: "ansible_selinux['status'] == 'enabled'"
@ -57,7 +57,7 @@
# If port can not be modified, it likely has to be added (Ex. Port 9002)
- name: Allow httpd to listen to port ({{browbeat_results_port}}) via add
shell: "/usr/sbin/semanage port -a -t http_port_t -p tcp {{browbeat_results_port}}"
command: "/usr/sbin/semanage port -a -t http_port_t -p tcp {{browbeat_results_port}}"
become: true
when: "(ansible_selinux['status'] == 'enabled') and (seport_modified.rc != 0)"

View File

@ -216,12 +216,12 @@
when: "(('controller' in group_names and {{apache_controller_collectd_plugin}} == true) or ('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == true))"
- name: (Undercloud) Allow httpd to listen to port ({{apache_undercloud_mod_status_port}})
shell: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_undercloud_mod_status_port}}"
command: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_undercloud_mod_status_port}}"
become: true
when: "('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == true)"
- name: (Controller) Allow httpd to listen to port ({{apache_controller_mod_status_port}})
shell: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_controller_mod_status_port}}"
command: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_controller_mod_status_port}}"
become: true
when: "(ansible_selinux['status'] == 'enabled') and ('controller' in group_names and {{apache_controller_collectd_plugin}} == true)"

View File

@ -14,7 +14,7 @@
- expect
- name: Check for graphite.db sqlite
shell: ls /var/lib/graphite-web/graphite.db
command: ls /var/lib/graphite-web/graphite.db
ignore_errors: true
register: graphite_db_installed

View File

@ -15,7 +15,7 @@
when: not rsyslog_aggregator
- name: Gather info about services
shell: "python /tmp/openstack-log-locator.py {{item}}"
command: "python /tmp/openstack-log-locator.py {{item}}"
with_items: "{{openstack_services}}"
register: log_config_lines
become: true
@ -115,7 +115,7 @@
# cool feature, exits 1 on invalid configs
- name: Validate rsyslog config
shell: "rsyslogd -nN 1"
command: "rsyslogd -nN 1"
become: true
- name: restart rsyslog

View File

@ -7,7 +7,7 @@
remote_user: "{{ browbeat_user }}"
tasks:
- name: Check external connectivity
shell: ping -c 1 google.com
command: ping -c 1 google.com
register: ping
ignore_errors: true

View File

@ -16,7 +16,7 @@ whitelist_externals = bash
commands =
bash -c "cd ansible; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint \
-x ANSIBLE0013,ANSIBLE0012,ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0016"
-x ANSIBLE0012,ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0016"
pykwalify -d browbeat-config.yaml -s browbeat/schema/browbeat.yml
pykwalify -d browbeat-complete.yaml -s browbeat/schema/browbeat.yml
bash -c "set -e; for config in $(ls conf/); do \