From c8630f72bec5b53fb10552a7ea55b0f41781d643 Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Thu, 11 Feb 2016 04:55:10 -0800 Subject: [PATCH] Resolve ansible-lint ANSIBLE0008 ansible-lint 2.3.7 added a rule checking for use of the deprecated 'sudo' and 'sudo_user' directives. They have been replaced with 'become' and 'become_user' respectively. Change-Id: I2271fe8468840884f19f41abba37e696c6296350 --- playbooks/repo-clone-mirror.yml | 8 ++++---- .../roles/os_cinder/tasks/cinder_db_setup.yml | 4 ++-- .../roles/os_glance/tasks/glance_db_setup.yml | 8 ++++---- playbooks/roles/os_heat/tasks/heat_db_setup.yml | 4 ++-- .../roles/os_horizon/tasks/horizon_db_setup.yml | 4 ++-- .../os_horizon/tasks/horizon_post_install.yml | 4 ++-- .../os_keystone/tasks/keystone_db_setup.yml | 4 ++-- .../tasks/keystone_fernet_keys_create.yml | 8 ++++---- .../tasks/keystone_fernet_keys_distribute.yml | 4 ++-- .../os_keystone/tasks/keystone_idp_metadata.yml | 4 ++-- .../roles/os_neutron/tasks/neutron_db_setup.yml | 12 ++++++------ playbooks/roles/os_nova/tasks/nova_db_setup.yml | 4 ++-- .../os_swift_sync/tasks/swift_rings_build.yml | 16 ++++++++-------- .../tasks/swift_rings_distribute.yml | 8 ++++---- .../swift_rings_post_distribution_check.yml | 16 ++++++++-------- test-requirements.txt | 2 +- tox.ini | 2 +- 17 files changed, 56 insertions(+), 56 deletions(-) diff --git a/playbooks/repo-clone-mirror.yml b/playbooks/repo-clone-mirror.yml index b08deb7b06..b2206c28a1 100644 --- a/playbooks/repo-clone-mirror.yml +++ b/playbooks/repo-clone-mirror.yml @@ -38,8 +38,8 @@ {{ rsync_flags }} \ --files-from=/tmp/MANIFEST.in \ {{ repo_upstream_url | netloc }}::{{ mirror_name }} {{ mirror_path }} - sudo: yes - sudo_user: "{{ repo_service_user_name }}" + become: yes + become_user: "{{ repo_service_user_name }}" - name: Create sync directories file: state: directory @@ -52,8 +52,8 @@ {{ rsync_flags }} \ {{ repo_upstream_url | netloc }}::{{ mirror_name }}/{{ item }}/ {{ mirror_path }}/{{ item }} with_items: rsync_dirs - sudo: yes - sudo_user: "{{ repo_service_user_name }}" + become: yes + become_user: "{{ repo_service_user_name }}" vars: rsync_commands: rsync rsync_flags: "-avzlHAX" diff --git a/playbooks/roles/os_cinder/tasks/cinder_db_setup.yml b/playbooks/roles/os_cinder/tasks/cinder_db_setup.yml index 09bcd24ca9..252c1ecc93 100644 --- a/playbooks/roles/os_cinder/tasks/cinder_db_setup.yml +++ b/playbooks/roles/os_cinder/tasks/cinder_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a cinder DB sync command: "{{ cinder_bin }}/cinder-manage db sync" - sudo: yes - sudo_user: "{{ cinder_system_user_name }}" + become: yes + become_user: "{{ cinder_system_user_name }}" tags: - cinder-db-sync - cinder-setup diff --git a/playbooks/roles/os_glance/tasks/glance_db_setup.yml b/playbooks/roles/os_glance/tasks/glance_db_setup.yml index d7bb8d091c..9b42df6efd 100644 --- a/playbooks/roles/os_glance/tasks/glance_db_setup.yml +++ b/playbooks/roles/os_glance/tasks/glance_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a Glance DB sync command: "{{ glance_bin }}/glance-manage db_sync" - sudo: yes - sudo_user: "{{ glance_system_user_name }}" + become: yes + become_user: "{{ glance_system_user_name }}" tags: - glance-db-sync - glance-setup @@ -50,8 +50,8 @@ - name: Load glance metadata definitions command: "{{ glance_bin }}/glance-manage db_load_metadefs {{ glance_etc_dir }}/metadefs" - sudo: yes - sudo_user: "{{ glance_system_user_name }}" + become: yes + become_user: "{{ glance_system_user_name }}" tags: - glance-db-sync - glance-setup diff --git a/playbooks/roles/os_heat/tasks/heat_db_setup.yml b/playbooks/roles/os_heat/tasks/heat_db_setup.yml index d10fe658e0..aba9d908f5 100644 --- a/playbooks/roles/os_heat/tasks/heat_db_setup.yml +++ b/playbooks/roles/os_heat/tasks/heat_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a heat DB sync command: "{{ heat_bin }}/heat-manage db_sync" - sudo: yes - sudo_user: "{{ heat_system_user_name }}" + become: yes + become_user: "{{ heat_system_user_name }}" tags: - heat-db-sync - heat-setup diff --git a/playbooks/roles/os_horizon/tasks/horizon_db_setup.yml b/playbooks/roles/os_horizon/tasks/horizon_db_setup.yml index 74562d1d8d..b647cd70d1 100644 --- a/playbooks/roles/os_horizon/tasks/horizon_db_setup.yml +++ b/playbooks/roles/os_horizon/tasks/horizon_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a horizon DB sync command: "{{ horizon_bin }}/horizon-manage.py syncdb --noinput" - sudo: yes - sudo_user: "{{ horizon_system_user_name }}" + become: yes + become_user: "{{ horizon_system_user_name }}" tags: - horizon-db-setup - horizon-db-sync diff --git a/playbooks/roles/os_horizon/tasks/horizon_post_install.yml b/playbooks/roles/os_horizon/tasks/horizon_post_install.yml index 4411d13a56..08822a9736 100644 --- a/playbooks/roles/os_horizon/tasks/horizon_post_install.yml +++ b/playbooks/roles/os_horizon/tasks/horizon_post_install.yml @@ -70,8 +70,8 @@ - name: Collect and compress static files command: "{{ item }}" - sudo: yes - sudo_user: "{{ horizon_system_user_name }}" + become: yes + become_user: "{{ horizon_system_user_name }}" with_items: - "{{ horizon_bin }}/horizon-manage.py collectstatic --noinput" - "{{ horizon_bin }}/horizon-manage.py compress --force" diff --git a/playbooks/roles/os_keystone/tasks/keystone_db_setup.yml b/playbooks/roles/os_keystone/tasks/keystone_db_setup.yml index 7c887187c7..d90642229f 100644 --- a/playbooks/roles/os_keystone/tasks/keystone_db_setup.yml +++ b/playbooks/roles/os_keystone/tasks/keystone_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a Keystone DB sync command: "{{ keystone_bin }}/keystone-manage db_sync" - sudo: yes - sudo_user: "{{ keystone_system_user_name }}" + become: yes + become_user: "{{ keystone_system_user_name }}" tags: - keystone-db-setup - keystone-db-sync diff --git a/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_create.yml b/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_create.yml index 15e5545785..c4ed0739da 100644 --- a/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_create.yml +++ b/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_create.yml @@ -25,8 +25,8 @@ {{ keystone_bin }}/keystone-manage fernet_setup --keystone-user "{{ keystone_system_user_name }}" --keystone-group "{{ keystone_system_group_name }}" - sudo: yes - sudo_user: "{{ keystone_system_user_name }}" + become: yes + become_user: "{{ keystone_system_user_name }}" when: not _fernet_keys.stat.exists tags: - keystone-setup @@ -38,8 +38,8 @@ {{ keystone_bin }}/keystone-manage fernet_rotate --keystone-user "{{ keystone_system_user_name }}" --keystone-group "{{ keystone_system_group_name }}" - sudo: yes - sudo_user: "{{ keystone_system_user_name }}" + become: yes + become_user: "{{ keystone_system_user_name }}" when: _fernet_keys.stat.exists tags: - keystone-fernet diff --git a/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_distribute.yml b/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_distribute.yml index 59302d93dc..c9e2f4337a 100644 --- a/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_distribute.yml +++ b/playbooks/roles/os_keystone/tasks/keystone_fernet_keys_distribute.yml @@ -20,8 +20,8 @@ --delete \ {{ keystone_fernet_tokens_key_repository }}/ \ {{ keystone_system_user_name }}@{{ hostvars[item]['ansible_ssh_host'] }}:{{ keystone_fernet_tokens_key_repository }}/ - sudo: yes - sudo_user: "{{ keystone_system_user_name }}" + become: yes + become_user: "{{ keystone_system_user_name }}" with_items: groups['keystone_all'][1:] tags: - keystone-fernet-distribute diff --git a/playbooks/roles/os_keystone/tasks/keystone_idp_metadata.yml b/playbooks/roles/os_keystone/tasks/keystone_idp_metadata.yml index 70e4e5f935..48eebac406 100644 --- a/playbooks/roles/os_keystone/tasks/keystone_idp_metadata.yml +++ b/playbooks/roles/os_keystone/tasks/keystone_idp_metadata.yml @@ -16,8 +16,8 @@ - name: Generate IdP metadata shell: | {{ keystone_bin }}/keystone-manage saml_idp_metadata > {{ keystone_idp.idp_metadata_path }} - sudo: yes - sudo_user: "{{ keystone_system_user_name }}" + become: yes + become_user: "{{ keystone_system_user_name }}" when: keystone_idp is defined notify: - Restart Apache diff --git a/playbooks/roles/os_neutron/tasks/neutron_db_setup.yml b/playbooks/roles/os_neutron/tasks/neutron_db_setup.yml index ed903f92f5..fdaefea934 100644 --- a/playbooks/roles/os_neutron/tasks/neutron_db_setup.yml +++ b/playbooks/roles/os_neutron/tasks/neutron_db_setup.yml @@ -62,8 +62,8 @@ --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade --expand - sudo: yes - sudo_user: "{{ neutron_system_user_name }}" + become: yes + become_user: "{{ neutron_system_user_name }}" when: - (neutron_migrations is defined and neutron_migrations['run_expand']|bool) - neutron_plugin_type == 'ml2' @@ -89,8 +89,8 @@ --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade --contract - sudo: yes - sudo_user: "{{ neutron_system_user_name }}" + become: yes + become_user: "{{ neutron_system_user_name }}" when: - (neutron_migrations is defined and neutron_migrations['run_contract']|bool) - neutron_plugin_type == 'ml2' @@ -107,8 +107,8 @@ --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade heads - sudo: yes - sudo_user: "{{ neutron_system_user_name }}" + become: yes + become_user: "{{ neutron_system_user_name }}" when: - neutron_plugin_type != 'ml2' tags: diff --git a/playbooks/roles/os_nova/tasks/nova_db_setup.yml b/playbooks/roles/os_nova/tasks/nova_db_setup.yml index c41767d0b4..f9880f20a5 100644 --- a/playbooks/roles/os_nova/tasks/nova_db_setup.yml +++ b/playbooks/roles/os_nova/tasks/nova_db_setup.yml @@ -41,8 +41,8 @@ - name: Perform a Nova DB sync command: "{{ nova_bin }}/nova-manage db sync" - sudo: yes - sudo_user: "{{ nova_system_user_name }}" + become: yes + become_user: "{{ nova_system_user_name }}" tags: - nova-db-setup - nova-setup diff --git a/playbooks/roles/os_swift_sync/tasks/swift_rings_build.yml b/playbooks/roles/os_swift_sync/tasks/swift_rings_build.yml index 1f2584d117..7f3d9932b8 100644 --- a/playbooks/roles/os_swift_sync/tasks/swift_rings_build.yml +++ b/playbooks/roles/os_swift_sync/tasks/swift_rings_build.yml @@ -56,8 +56,8 @@ - account - container when: swift_managed_regions is not defined - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -69,8 +69,8 @@ with_nested: - [ 'account', 'container' ] - swift_managed_regions | default([]) - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -82,8 +82,8 @@ with_items: - "{{ swift.storage_policies }}" when: swift_managed_regions is not defined - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -95,8 +95,8 @@ with_nested: - "{{ swift.storage_policies }}" - swift_managed_regions | default([]) - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: diff --git a/playbooks/roles/os_swift_sync/tasks/swift_rings_distribute.yml b/playbooks/roles/os_swift_sync/tasks/swift_rings_distribute.yml index 6645c17d31..c1ae6eac5b 100644 --- a/playbooks/roles/os_swift_sync/tasks/swift_rings_distribute.yml +++ b/playbooks/roles/os_swift_sync/tasks/swift_rings_distribute.yml @@ -20,8 +20,8 @@ dest: "/etc/swift/" set_remote_user: False delegate_to: "{{ groups['swift_hosts'][0] }}" - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" tags: - swift-get-rings @@ -32,7 +32,7 @@ dest: "/etc/swift/ring_build_files/" set_remote_user: False delegate_to: "{{ groups['swift_hosts'][0] }}" - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" tags: - swift-get-rings diff --git a/playbooks/roles/os_swift_sync/tasks/swift_rings_post_distribution_check.yml b/playbooks/roles/os_swift_sync/tasks/swift_rings_post_distribution_check.yml index 388ab0e115..8aeeb96b77 100644 --- a/playbooks/roles/os_swift_sync/tasks/swift_rings_post_distribution_check.yml +++ b/playbooks/roles/os_swift_sync/tasks/swift_rings_post_distribution_check.yml @@ -49,8 +49,8 @@ - account - container when: swift_managed_regions is not defined - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -62,8 +62,8 @@ with_nested: - [ 'account', 'container' ] - swift_managed_regions | default([]) - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -75,8 +75,8 @@ with_items: - "{{ swift.storage_policies }}" when: swift_managed_regions is not defined - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: @@ -88,8 +88,8 @@ with_nested: - "{{ swift.storage_policies }}" - swift_managed_regions | default([]) - sudo: yes - sudo_user: "{{ swift_system_user_name }}" + become: yes + become_user: "{{ swift_system_user_name }}" args: chdir: /etc/swift/ring_build_files/ tags: diff --git a/test-requirements.txt b/test-requirements.txt index 6d7193c2e6..0b11c9fabd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -ansible-lint>=2.0.3,<2.3.8 +ansible-lint>=2.0.3 flake8==2.2.4 hacking>=0.10.0,<0.11 pep8==1.5.7 diff --git a/tox.ini b/tox.ini index bc75ca5106..de4ee1b497 100644 --- a/tox.ini +++ b/tox.ini @@ -69,7 +69,7 @@ commands = [testenv:ansible-lint] deps = ansible>1.9,<2.0 - ansible-lint>=2.0.3,<2.3.8 + ansible-lint whitelist_externals = bash commands = # Perform an Ansible lint check