2014-02-11 21:21:09 +00:00
|
|
|
# requires --extra-vars="target='host1;host2;group etc' package='python-tahrir'"
|
2013-08-16 14:16:05 +00:00
|
|
|
#
|
2013-08-16 14:24:07 +00:00
|
|
|
# Alternatively, you could update a group of packages like
|
2014-02-09 23:06:54 +00:00
|
|
|
# --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"
|
2013-08-16 14:16:05 +00:00
|
|
|
|
|
|
|
- name: push packages out
|
2014-08-06 07:29:49 +02:00
|
|
|
hosts: "{{target}}"
|
2013-08-16 14:16:05 +00:00
|
|
|
user: root
|
|
|
|
|
2014-06-15 19:41:11 +00:00
|
|
|
vars:
|
|
|
|
testing: False
|
|
|
|
|
2013-08-16 14:16:05 +00:00
|
|
|
tasks:
|
2013-08-16 14:30:31 +00:00
|
|
|
|
2014-08-06 08:19:11 +00:00
|
|
|
- name: yum update {{ package }} from main repo
|
2015-10-05 14:25:05 +00:00
|
|
|
yum: name="{{ package }}" state=latest update_cache=yes
|
2015-11-17 15:31:51 +01:00
|
|
|
when: not testing and ansible_distribution_major_version|int < 22
|
2014-08-06 08:19:11 +00:00
|
|
|
|
|
|
|
- name: yum update {{ package }} from testing repo
|
2015-10-05 14:25:05 +00:00
|
|
|
yum: name="{{ package }}" state=latest enablerepo=infrastructure-testing update_cache=yes
|
2015-11-17 15:31:51 +01:00
|
|
|
when: testing and ansible_distribution_major_version|int < 22
|
|
|
|
|
2015-11-19 10:08:15 +01:00
|
|
|
- name: dnf update {{ package }} from main repo
|
2015-11-19 10:05:52 +01:00
|
|
|
dnf: name="{{ package }}" state=latest
|
2015-11-17 15:31:51 +01:00
|
|
|
when: not testing and ansible_distribution_major_version|int > 22
|
|
|
|
|
2015-11-19 10:08:15 +01:00
|
|
|
- name: dnf update {{ package }} from testing repo
|
2015-11-19 10:05:52 +01:00
|
|
|
dnf: name="{{ package }}" state=latest enablerepo=infrastructure-testing
|
2015-11-17 15:31:51 +01:00
|
|
|
when: testing and ansible_distribution_major_version|int > 22
|
|
|
|
|