From c1f38edcea285721c04977ffa0a1f1391990e28b Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Fri, 21 Jul 2017 09:05:16 +0200 Subject: [PATCH] ansible-linters fixes https://review.openstack.org/#/c/485259/ is throwing linters problems related to this role. I think all of them are fixed with this patch Change-Id: If3924bb1b7823a9c70edf68d0127b9415885a2d9 --- defaults/main.yml | 1 + tasks/main.yml | 2 +- tasks/tacker_db_setup.yml | 3 +-- tasks/tacker_init_upstart.yml | 8 +------- tasks/tacker_install.yml | 8 ++------ 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index bcacc6e..f78750d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,7 @@ verbose: True # Set the package install state for distribution packages # Options are 'present' and 'latest' tacker_package_state: "latest" +tacker_pip_package_state: "latest" tacker_git_repo: https://git.openstack.org/openstack/tacker tacker_git_install_branch: master diff --git a/tasks/main.yml b/tasks/main.yml index 9bc9970..f58cfe5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -30,7 +30,7 @@ - name: Check init system command: cat /proc/1/comm register: _pid1_name - changed_when: false + changed_when: False tags: - always diff --git a/tasks/tacker_db_setup.yml b/tasks/tacker_db_setup.yml index 3e12649..bcc20d6 100644 --- a/tasks/tacker_db_setup.yml +++ b/tasks/tacker_db_setup.yml @@ -13,14 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -# TODO(mbuil): Fix the ansible lint - name: Perform a tacker DB sync command: "{{ tacker_bin }}/tacker-db-manage --config-file {{ tacker_etc_dir }}/tacker.conf upgrade head" become: yes become_user: "{{ tacker_system_user_name }}" + changed_when: False tags: - tacker-db-sync - tacker-setup - tacker-command-bin - - skip_ansible_lint diff --git a/tasks/tacker_init_upstart.yml b/tasks/tacker_init_upstart.yml index 7d6f6de..c6b59e6 100644 --- a/tasks/tacker_init_upstart.yml +++ b/tasks/tacker_init_upstart.yml @@ -26,14 +26,8 @@ notify: - Restart tacker services -# TODO(mbuil): Fix the ansible lint -# probably replace shell by command - name: Reload init scripts - shell: | - initctl reload-configuration + command: initctl reload-configuration when: upstart_init | changed notify: - Restart tacker services - tags: - - skip_ansible_lint - diff --git a/tasks/tacker_install.yml b/tasks/tacker_install.yml index 807bfde..f004df6 100644 --- a/tasks/tacker_install.yml +++ b/tasks/tacker_install.yml @@ -51,12 +51,10 @@ when: - not tacker_developer_mode | bool -# TODO(mbuil): Fix the ansible lint -# Hint: latest should be a var. - name: Install requires pip packages pip: name: "{{ tacker_requires_pip_packages | join(' ') }}" - state: latest + state: "{{ tacker_pip_package_state }}" extra_args: "{{ pip_install_options_fact }}" register: install_packages until: install_packages|success @@ -115,12 +113,10 @@ notify: - Restart tacker services -# TODO(mbuil): Fix the ansible lint -# hint: latest should be a var. - name: Install pip packages pip: name: "{{ tacker_pip_packages | join(' ') }}" - state: latest + state: "{{ tacker_pip_package_state }}" virtualenv: "{{ tacker_bin | dirname }}" virtualenv_site_packages: "no" extra_args: "{{ pip_install_options_fact }}"