diff --git a/defaults/main.yml b/defaults/main.yml index a78616d..8ad97a9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,9 +16,10 @@ ## Verbosity Options debug: False -# Set the package install state for distribution packages +# Set the package install state for distribution and pip packages # Options are 'present' and 'latest' watcher_package_state: "latest" +watcher_pip_package_state: "latest" ## Toggle developer mode watcher_developer_mode: false diff --git a/tasks/main.yml b/tasks/main.yml index ca1c8cf..538ad7d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,6 +34,7 @@ - name: Check init system command: cat /proc/1/comm + changed_when: false register: _pid1_name tags: - always diff --git a/tasks/watcher_db_setup.yml b/tasks/watcher_db_setup.yml index b9b1db4..32c99f7 100644 --- a/tasks/watcher_db_setup.yml +++ b/tasks/watcher_db_setup.yml @@ -17,6 +17,7 @@ command: "{{ watcher_bin }}/watcher-db-manage --config-file /etc/watcher/watcher.conf create_schema" become: yes become_user: "{{ watcher_system_user_name }}" + changed_when: false tags: - watcher-db-setup - watcher-setup diff --git a/tasks/watcher_init_upstart.yml b/tasks/watcher_init_upstart.yml index feecf9f..f768ea7 100644 --- a/tasks/watcher_init_upstart.yml +++ b/tasks/watcher_init_upstart.yml @@ -25,8 +25,7 @@ - Restart watcher services - name: Reload init scripts - shell: | - initctl reload-configuration + command: initctl reload-configuration when: upstart_init | changed notify: - Restart watcher services diff --git a/tasks/watcher_install.yml b/tasks/watcher_install.yml index 32f3515..d41ccfc 100644 --- a/tasks/watcher_install.yml +++ b/tasks/watcher_install.yml @@ -30,7 +30,7 @@ - name: Install requires pip packages pip: name: "{{ watcher_requires_pip_packages | join(' ') }}" - state: latest + state: "{{ watcher_pip_package_state }}" extra_args: >- {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} @@ -106,7 +106,7 @@ - name: Install pip packages pip: name: "{{ watcher_pip_packages | join(' ') }}" - state: latest + state: "{{ watcher_pip_package_state }}" virtualenv: "{{ watcher_bin | dirname }}" virtualenv_site_packages: "no" extra_args: >-