From 2bd05385420108f0b9467a757451b317931132a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 16 Aug 2017 15:41:59 +0200 Subject: [PATCH] Manage Stretch repositories. --- CHANGELOG.md | 5 ++++ README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++ defaults/main.yml | 6 +++++ meta/main.yml | 24 +++++++++++++++++++ tasks/main.yml | 23 ++++++++++++++++++ tests/inventory | 1 + tests/test.yml | 5 ++++ 7 files changed, 123 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/main.yml create mode 100644 tests/inventory create mode 100644 tests/test.yml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6115a81 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ + +## v1.0 + +### Features +* Manage Stretch repositories. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a69e5b --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# Apt + +1. [Overview](#overview) +2. [Role Variables](#role-variables) +3. [Example Playbook](#example-playbook) +4. [Configuration](#configuration) +5. [Development](#development) +6. [License](#license) +7. [Author Information](#author-information) + +## Overview + +Manage APT repos, preferences and configuration for IPR's servers. + +## Role Variables + +* **apt_src_list_manage** : If apt sources list files should be managed [default : `true`]. +* **apt_stretch_manage** : If Stretch configuration should be managed [default : `true`]. + +## Example Playbook + +* Use defaults vars : + +``` yml +- hosts: serverXYZ + roles: + - role: ipr-cnrs.apt +``` + +## Configuration + +### Sources List + +Manage Debian's sources.list : +* Add Stretch repositories. + +## Development + +This source code comes from our [Gogs instance][apt source] and the [Github repo][apt github] exist just to be able to send the role to Ansible Galaxy… + +But feel free to send issue/PR here :) + +Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][apt source] :) + +## License + +[WTFPL][wtfpl website] + +## Author Information + +Jérémy Gardais +* Source : [on IPR's Gogs][apt source] +* [IPR][ipr website] (Institut de Physique de Rennes) + +[gogs to github hook]: https://stackoverflow.com/a/21998477 +[apt source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.apt +[apt github]: https://github.com/ipr-cnrs/apt +[wtfpl website]: http://www.wtfpl.net/about/ +[ipr website]: https://ipr.univ-rennes1.fr/ diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..a3ab90b --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,6 @@ +--- +# defaults file for apt + +apt_src_list_manage: true + +apt_stretch_manage: true diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..66d8629 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,24 @@ +galaxy_info: + author: "Jérémy Gardais" + description: "Manage APT repos, preferences and configuration for IPR's servers." + license: WTFPL + company: IPR + issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.apt/issues + min_ansible_version: 2.2 + platforms: + - name: Debian + versions: + - stretch + #- name: opensuse + # versions: + # - all + # - 12.1 + # - 12.2 + # - 12.3 + # - 13.1 + # - 13.2 + galaxy_tags: + - system + - apt + - package + - debian diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..5ca1cc1 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,23 @@ +--- +# tasks file for apt + +# Sources list +## Stretch +- name: CONFIG stretch official sources.list + apt_repository: + repo: "{{ item }} http://httpredir.debian.org/debian/ stretch main contrib non-free" + filename: stretch + update_cache: no + with_items: + - deb + - deb-src + when: apt_src_list_manage and apt_stretch_manage + +- name: CONFIG stretch backports sources.list + apt_repository: + repo: "deb http://httpredir.debian.org/debian/ stretch-{{ item }} main contrib non-free" + filename: stretch.bpo + update_cache: no + with_items: + - backports + when: apt_src_list_manage and apt_stretch_manage diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..09d344b --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - apt \ No newline at end of file