Skip to content
Permalink
Browse files

re-enabling ansible-lint rules 102 and 601

Change-Id: Ib4c31055f3243b168d943948a6ec3e6c2739f93f
  • Loading branch information...
aakarshgopi authored and smalleni committed Jan 30, 2019
1 parent 86bfc78 commit 6afbfc7c3f69e55a24c4e6086f559a84adcc805a
@@ -1,13 +1,11 @@
---
parseable: true
skip_list:
- '102' # [E102] No Jinja2 in when
- '204' # [E204] Lines should be no longer than 120 chars
- '206' # [E206] Variables should have spaces before and after: {{ var_name }}
- '405'
- '503' # [E503] Tasks that run when changed should likely be handlers
- '504'
- '601' # [E601] Don't compare to literal True/False
- '602' # [E602] Don't compare to empty string
- ANSIBLE0006
- ANSIBLE0007
@@ -12,7 +12,7 @@
group: ceilometer
mode: 0640
backup: true
when: "{{reduced_metrics}} == false and ('Newton' in osp_version['content'] | b64decode)"
when: "not reduced_metrics and ('Newton' in osp_version['content'] | b64decode)"

- name: (Newton) Deploy the reduced metrics pipeline.yaml file
become: true
@@ -23,7 +23,7 @@
group: ceilometer
mode: 0640
backup: true
when: "{{reduced_metrics}} == true and ('Newton' in osp_version['content'] | b64decode)"
when: "reduced_metrics and ('Newton' in osp_version['content'] | b64decode)"

- name: (Ocata) Deploy polling.yaml file
become: true
@@ -34,7 +34,7 @@
group: ceilometer
mode: 0640
backup: true
when: "{{reduced_metrics}} == false and ('Ocata' in osp_version['content'] | b64decode)"
when: "not reduced_metrics and ('Ocata' in osp_version['content'] | b64decode)"

- name: (Ocata) Deploy the reduced metrics polling.yaml file
become: true
@@ -45,7 +45,7 @@
group: ceilometer
mode: 0640
backup: true
when: "{{reduced_metrics}} == true and ('Ocata' in osp_version['content'] | b64decode or 'Pike')"
when: "reduced_metrics and ('Ocata' in osp_version['content'] | b64decode or 'Pike')"

- name: (Containerized Pike) Deploy the polling.yaml
become: true
@@ -11,25 +11,25 @@
- name: stop keystone service
become: true
service: name=openstack-keystone state=stopped
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"

- name: restart httpd service
become: true
service: name=httpd state=restarted
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"

- name: restart keystone service
become: true
service: name=openstack-keystone state=restarted
when: "'eventlet' in '{{ keystone_deployment }}'"
when: "'eventlet' in keystone_deployment"

- name: pacemaker default managed
become: true
command: pcs property set is-managed-default=true
when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled"
when: "'eventlet' in keystone_deployment and pacemaker_controlled"

- name: pacemaker cleanup keystone
become: true
command: pcs resource cleanup openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled"
when: "'eventlet' in keystone_deployment and pacemaker_controlled"
ignore_errors: true
@@ -31,15 +31,15 @@

- name: Set current_token_provider variable/fact to uuid
set_fact: current_token_provider='uuid'
when: "'uuid' in '{{ keystone_token_provider.stdout }}'"
when: "'uuid' in keystone_token_provider.stdout"

- name: Set current_token_provider variable/fact to fernet
set_fact: current_token_provider='fernet'
when: "'fernet' in '{{ keystone_token_provider.stdout }}'"
when: "'fernet' in keystone_token_provider.stdout"

- name: Set current_token_provider variable/fact to pkiz
set_fact: current_token_provider='pkiz'
when: "'pkiz' in '{{ keystone_token_provider.stdout }}'"
when: "'pkiz' in keystone_token_provider.stdout"

#
# Tasks to change token provider if necessary:
@@ -48,7 +48,7 @@
- name: Change token provider
become: true
command: crudini --set /etc/keystone/keystone.conf token provider "keystone.token.providers.{{ token_provider }}.Provider"
when: "'{{ current_token_provider }}' != '{{ token_provider }}'"
when: "current_token_provider != token_provider"
notify:
- pacemaker default unmanaged
- stop keystone service
@@ -69,20 +69,20 @@
owner=keystone
group=keystone
mode=0700
when: "'{{ token_provider }}' == 'fernet'"
when: "token_provider == 'fernet'"

- name: Setup fernet keys
become: true
command: keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
when: ('{{ token_provider }}' == 'fernet') and (inventory_hostname == groups['controller'][0])
when: (token_provider == 'fernet') and (inventory_hostname == groups['controller'][0])

- name: Get fernet keys
become: true
fetch: src=/etc/keystone/fernet-keys/{{ item }} dest=roles/keystone-token/files/{{ item }} flat=yes
with_items:
- 0
- 1
when: ('{{ token_provider }}' == 'fernet') and (inventory_hostname == groups['controller'][0])
when: (token_provider == 'fernet') and (inventory_hostname == groups['controller'][0])
changed_when: false

- name: Copy fernet keys
@@ -91,26 +91,26 @@
with_items:
- "0"
- "1"
when: ('{{ token_provider }}' == 'fernet') and (inventory_hostname != groups['controller'][0])
when: (token_provider == 'fernet') and (inventory_hostname != groups['controller'][0])

- name: Copy keystone type enforcement file
become: true
copy:
src: my-keystone.te
dest: /root/my-keystone.te
when: "'{{ token_provider }}' == 'fernet'"
when: "token_provider == 'fernet'"

- name: Create keystone.mod file
become: true
command: checkmodule -M -m -o /root/my-keystone.mod /root/my-keystone.te
when: "'{{ token_provider }}' == 'fernet'"
when: "token_provider == 'fernet'"

- name: Create keystone.pp file
become: true
command: semodule_package -o /root/my-keystone.pp -m /root/my-keystone.mod
when: "'{{ token_provider }}' == 'fernet'"
when: "token_provider == 'fernet'"

- name: Install keystone selinux policy
become: true
command: semodule -i /root/my-keystone.pp
when: "'{{ token_provider }}' == 'fernet'"
when: "token_provider == 'fernet'"
@@ -12,7 +12,7 @@
- name: stop keystone eventlet
become: true
service: name=openstack-keystone state=stopped
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"
ignore_errors: true

- name: restart httpd
@@ -22,7 +22,7 @@
- name: restart keystone
become: true
service: name=openstack-keystone state=restarted
when: "'eventlet' in '{{ keystone_deployment }}'"
when: "'eventlet' in keystone_deployment"

- name: pacemaker managed default
become: true
@@ -35,7 +35,7 @@
- name: cleanup keystone
become: true
command: pcs resource cleanup openstack-keystone
when: "'eventlet' in '{{ keystone_deployment }}' and pacemaker_controlled"
when: "'eventlet' in keystone_deployment and pacemaker_controlled"
ignore_errors: true

- name: cleanup httpd
@@ -50,7 +50,7 @@
- { section: DEFAULT, option: admin_workers, value: "{{ workers }}" }
- { section: eventlet_server, option: public_workers, value: "{{ workers }}" }
- { section: eventlet_server, option: admin_workers, value: "{{ workers }}" }
when: "'eventlet' in '{{ keystone_deployment }}'"
when: "'eventlet' in keystone_deployment"
notify:
- pacemaker unmanaged default
- stop keystone eventlet
@@ -66,7 +66,7 @@
with_items:
- admin
- main
when: "'eventlet' in '{{ keystone_deployment }}'"
when: "'eventlet' in keystone_deployment"
notify:
- restart httpd
- cleanup httpd
@@ -78,7 +78,7 @@
state: directory
owner: keystone
group: keystone
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"

- name: Copy keystone in httpd files over
become: true
@@ -92,7 +92,7 @@
with_items:
- admin
- main
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"
ignore_errors: true

- name: Configure httpd processes/threads
@@ -115,7 +115,7 @@
processes: "{{ workers }}"
port: 5000
threads: "{{ threads }}"
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"
notify:
- pacemaker unmanaged default
- stop keystone eventlet
@@ -130,7 +130,7 @@
with_items:
- "{{ public_ip_addr.stdout | default('') }}:5000"
- "{{ admin_ip_addr.stdout | default('') }}:35357"
when: "'httpd' in '{{ keystone_deployment }}'"
when: "'httpd' in keystone_deployment"
notify:
- pacemaker unmanaged default
- stop keystone eventlet
@@ -147,7 +147,7 @@
with_items:
- "{{ public_ip_addr.stdout | default('') }}:5000"
- "{{ admin_ip_addr.stdout | default('') }}:35357"
when: "'eventlet' in '{{ keystone_deployment }}'"
when: "'eventlet' in keystone_deployment"
notify:
- pacemaker unmanaged default
- stop keystone eventlet
@@ -36,7 +36,7 @@
dest: "/usr/lib/systemd/system/virtlogd.service"
line: "LimitNOFILE={{max_open_files}}"
insertafter: "OOMScoreAdjust=-900"
when: replace_output.changed != true
when: not replace_output.changed

- name: Issue daemon-reload
become: true
@@ -82,18 +82,18 @@

- name: Generate hosts and ssh-config on Browbeat Machine - Default(stack)
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_hostfile.sh -t localhost --user stack
when: tripleo == true and (hosts_file_exists.stat.exists == false or hosts_file_exists.stat.isreg == false) and ansible_user!= "zuul"
when: tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg) and ansible_user!= "zuul"

- name: Generate hosts and ssh-config on Browbeat Machine - Zuul
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_hostfile.sh -t localhost --user zuul
when: tripleo == true and (hosts_file_exists.stat.exists == false or hosts_file_exists.stat.isreg == false) and ansible_user== "zuul"
when: tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg) and ansible_user== "zuul"

- name: Move files to correct location
command: mv {{ home_dir }}/{{item}} {{ browbeat_path }}/ansible/{{item}}
with_items:
- hosts
- heat-admin-id_rsa
when: "(tripleo == true and (hosts_file_exists.stat.exists == false or hosts_file_exists.stat.isreg == false))"
when: "(tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg))"

- name: Install requirements.txt into browbeat-venv
pip:
Oops, something went wrong.

0 comments on commit 6afbfc7

Please sign in to comment.
You can’t perform that action at this time.