diff --git a/defaults/main.yml b/defaults/main.yml index 61ceebe..96dcc6a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Set the package install state for distribution packages +# Options are 'present' and 'latest' +haproxy_package_state: "latest" + ## Haproxy Configuration haproxy_rise: 3 haproxy_fall: 3 diff --git a/tasks/haproxy_add_ppa_repo.yml b/tasks/haproxy_add_ppa_repo.yml index f7cc6c0..246f176 100644 --- a/tasks/haproxy_add_ppa_repo.yml +++ b/tasks/haproxy_add_ppa_repo.yml @@ -35,7 +35,7 @@ - name: Install haproxy pre packages apt: pkg: "{{ item }}" - state: latest + state: "{{ haproxy_package_state }}" register: install_packages until: install_packages|success retries: 5 diff --git a/tasks/haproxy_install_apt.yml b/tasks/haproxy_install_apt.yml index a6533a3..55b83fd 100644 --- a/tasks/haproxy_install_apt.yml +++ b/tasks/haproxy_install_apt.yml @@ -38,7 +38,7 @@ - name: Install HAProxy Packages apt: pkg: "{{ item }}" - state: latest + state: "{{ haproxy_package_state }}" register: install_packages until: install_packages|success retries: 5 diff --git a/tasks/haproxy_install_yum.yml b/tasks/haproxy_install_yum.yml index 67265fc..810fde8 100644 --- a/tasks/haproxy_install_yum.yml +++ b/tasks/haproxy_install_yum.yml @@ -16,7 +16,7 @@ - name: Install yum packages yum: pkg: "{{ item }}" - state: present + state: "{{ haproxy_package_state }}" register: install_packages until: install_packages|success retries: 5