From b52b740104021dbd71b24f6d8ce42f76faee063e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sun, 9 Feb 2014 23:06:54 +0000 Subject: [PATCH] Add support for the testing repo to the update_packages playbook --- playbooks/update_packages.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/playbooks/update_packages.yml b/playbooks/update_packages.yml index a7c2673b31..b94fb0d80b 100644 --- a/playbooks/update_packages.yml +++ b/playbooks/update_packages.yml @@ -1,18 +1,22 @@ # requires --extra-vars="target='host1;host2;group etc' package='python-tahrir' # # Alternatively, you could update a group of packages like -# --extra-vars="package='python-t*'" - -# TODO -- how do make it easy to select the infra-testing repo? +# --extra-vars="target='host1;host2' package='python-t*'" +# +# To update from testing, adjust as follow: +# --extra-vars="target='host1;host2' package='python-t*' testing=True" - name: push packages out hosts: "{{ target }}" user: root + vars: + testing: False + tasks: - - name: expire-caches - command: yum clean expire-cache + - name: expire-caches {% if testing %}(with infrastructure-testing on){% endif %} + command: yum clean expire-cache {% if testing %} --enablerepo=infrastructure-testing {% endif %} - - name: yum update {{ package }} - yum: name={{ package }} state=latest + - name: yum update {{ package }} {% if testing %}(with infrastructure-testing on){% endif %} + yum: name={{ package }} state=latest # {% if testing %}enablerepo=infrastructure-testing{% endif %}