spacewalk.ansible/roles/spacewalk-customisations/tasks/debian-sync.yml

28 lines
1.2 KiB
YAML

---
- name: Install pip
yum: name=python-pip state=present
- name: Install/update python-debian
pip: name=python-debian state=latest
- name: Install git
yum: name=git state=present
- name: get sync scripts
git: repo=https://github.com/philicious/spacewalk-scripts.git dest={{spacewalk_scripts_dir}}
- name: Patch the python debian library
lineinfile: dest=/usr/lib/python2.7/site-packages/debian/debfile.py regexp='^PART_EXTS =' line="PART_EXTS = ['gz', 'bz2', 'xz', 'lzma']"
- name: Add base channels
command: spacecmd --user=admin --password={{spacewalk_admin_password}} -- softwarechannel_create -n {{item.name}} -l {{item.label}} -a {{item.arch}} -c sha512
ignore_errors: true
with_items: "{{spacewalk_deb_repo_info}}"
- name: Get the trusted SSL certs
get_url: url=http://localhost/pub/RHN-ORG-TRUSTED-SSL-CERT dest=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
- name: Add cron jobs for synchronizing Debian repos
cron: name="{{item.name}} repo sync" minute="0" hour="7,19" job="{{spacewalk_scripts_dir}}debianSync.py --username=admin --password={{spacewalk_admin_password}} --channel {{item.label}} --url {{item.repo_url}}"
with_items: "{{spacewalk_deb_repo_info}}"