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:
parent
cf24a5aa48
commit
959bed59a5
@ -112,5 +112,5 @@
|
|||||||
|
|
||||||
- name: Install keystone selinux policy
|
- name: Install keystone selinux policy
|
||||||
become: true
|
become: true
|
||||||
shell: semodule -i /root/my-keystone.pp
|
command: semodule -i /root/my-keystone.pp
|
||||||
when: "'{{ token_provider }}' == 'fernet'"
|
when: "'{{ token_provider }}' == 'fernet'"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
- name: Check Ceph cluster health status
|
- name: Check Ceph cluster health status
|
||||||
shell: ceph status
|
command: ceph status
|
||||||
register: ceph_status
|
register: ceph_status
|
||||||
failed_when: "'HEALTH_OK' not in '{{ ceph_status.stdout }}'"
|
failed_when: "'HEALTH_OK' not in '{{ ceph_status.stdout }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Tests common to Director/Controller/Compute/Ceph
|
# Tests common to Director/Controller/Compute/Ceph
|
||||||
#
|
#
|
||||||
- name: Ensure crudini
|
- name: Ensure crudini
|
||||||
shell: which crudini
|
command: which crudini
|
||||||
changed_when: no
|
changed_when: no
|
||||||
register: crudini
|
register: crudini
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
- name: Get httpd configuration files
|
- name: Get httpd configuration files
|
||||||
shell: 'ls /etc/httpd/conf.d/'
|
command: 'ls /etc/httpd/conf.d/'
|
||||||
register: httpd_confd_files
|
register: httpd_confd_files
|
||||||
|
|
||||||
- name: Gnocchi API httpd process count
|
- name: Gnocchi API httpd process count
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
- name: Parse Ceilometer config
|
- name: Parse Ceilometer config
|
||||||
become: true
|
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
|
when: ceilometer_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
- name: Parse Cinder config
|
- name: Parse Cinder config
|
||||||
become: true
|
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
|
when: cinder_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
openstack_ovs_version: "{{ ovs_version.stdout }}"
|
openstack_ovs_version: "{{ ovs_version.stdout }}"
|
||||||
|
|
||||||
- name: Get neutron ovs agent ovsdb setting
|
- 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
|
register: ovsdb_status
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
template: src=dump_facts.j2 dest={{ browbeat_path }}/metadata/machine_facts.json
|
template: src=dump_facts.j2 dest={{ browbeat_path }}/metadata/machine_facts.json
|
||||||
|
|
||||||
- name: Generate metadata jsons
|
- name: Generate metadata jsons
|
||||||
shell : python {{ browbeat_path }}/browbeat/metadata.py {{ browbeat_path }}/metadata
|
command: python {{ browbeat_path }}/browbeat/metadata.py {{ browbeat_path }}/metadata
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
- name: Parse Glance config files
|
- name: Parse Glance config files
|
||||||
become: true
|
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
|
- name: Fetch output
|
||||||
fetch: "src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes"
|
fetch: "src=/tmp/out.yml dest=/tmp/out-{{ inventory_hostname }}.yml flat=yes"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Parse Gnocchi config
|
- name: Parse Gnocchi config
|
||||||
become: true
|
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
|
when: gnocchi_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Parse Heat config
|
- name: Parse Heat config
|
||||||
become: true
|
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
|
when: heat_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Parse Keystone config
|
- name: Parse Keystone config
|
||||||
become: true
|
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
|
when: keystone_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Parse Neutron config
|
- name: Parse Neutron config
|
||||||
become: true
|
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
|
when: neutron_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Parse Nova config
|
- name: Parse Nova config
|
||||||
become: true
|
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
|
when: nova_config.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
- name: Undercloud.conf
|
- name: Undercloud.conf
|
||||||
become: true
|
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
|
when: undercloud_conf.stat.exists
|
||||||
|
|
||||||
- name: Fetch output
|
- name: Fetch output
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
# https://github.com/ansible/ansible-modules-extras/pull/2694
|
# https://github.com/ansible/ansible-modules-extras/pull/2694
|
||||||
# This is not in upstream Ansible releases as of 2.1.1.0
|
# This is not in upstream Ansible releases as of 2.1.1.0
|
||||||
- name: Allow httpd to listen to port ({{browbeat_results_port}})
|
- 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
|
become: true
|
||||||
register: seport_modified
|
register: seport_modified
|
||||||
when: "ansible_selinux['status'] == 'enabled'"
|
when: "ansible_selinux['status'] == 'enabled'"
|
||||||
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
# If port can not be modified, it likely has to be added (Ex. Port 9002)
|
# 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
|
- 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
|
become: true
|
||||||
when: "(ansible_selinux['status'] == 'enabled') and (seport_modified.rc != 0)"
|
when: "(ansible_selinux['status'] == 'enabled') and (seport_modified.rc != 0)"
|
||||||
|
|
||||||
|
@ -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))"
|
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}})
|
- 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
|
become: true
|
||||||
when: "('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == 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}})
|
- 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
|
become: true
|
||||||
when: "(ansible_selinux['status'] == 'enabled') and ('controller' in group_names and {{apache_controller_collectd_plugin}} == true)"
|
when: "(ansible_selinux['status'] == 'enabled') and ('controller' in group_names and {{apache_controller_collectd_plugin}} == true)"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
- expect
|
- expect
|
||||||
|
|
||||||
- name: Check for graphite.db sqlite
|
- 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
|
ignore_errors: true
|
||||||
register: graphite_db_installed
|
register: graphite_db_installed
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
when: not rsyslog_aggregator
|
when: not rsyslog_aggregator
|
||||||
|
|
||||||
- name: Gather info about services
|
- 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}}"
|
with_items: "{{openstack_services}}"
|
||||||
register: log_config_lines
|
register: log_config_lines
|
||||||
become: true
|
become: true
|
||||||
@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
# cool feature, exits 1 on invalid configs
|
# cool feature, exits 1 on invalid configs
|
||||||
- name: Validate rsyslog config
|
- name: Validate rsyslog config
|
||||||
shell: "rsyslogd -nN 1"
|
command: "rsyslogd -nN 1"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: restart rsyslog
|
- name: restart rsyslog
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
remote_user: "{{ browbeat_user }}"
|
remote_user: "{{ browbeat_user }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Check external connectivity
|
- name: Check external connectivity
|
||||||
shell: ping -c 1 google.com
|
command: ping -c 1 google.com
|
||||||
register: ping
|
register: ping
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
2
tox.ini
2
tox.ini
@ -16,7 +16,7 @@ whitelist_externals = bash
|
|||||||
commands =
|
commands =
|
||||||
bash -c "cd ansible; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
bash -c "cd ansible; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
||||||
ansible-lint \
|
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-config.yaml -s browbeat/schema/browbeat.yml
|
||||||
pykwalify -d browbeat-complete.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 \
|
bash -c "set -e; for config in $(ls conf/); do \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user