From 193f933e1cb5fdc655ea3f6c60b3022faa41762f Mon Sep 17 00:00:00 2001 From: AnsibleRoles <> Date: Mon, 30 Dec 2019 21:36:05 +0000 Subject: [PATCH 01/27] Initial commit --- .gitignore | 90 +++++++++++++++++++++++++++++ LICENSE | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 3 files changed, 255 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6caeae7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,90 @@ +# ---> Ansible +*.retry + +# ---> Vim +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# ---> Linux +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# ---> Windows +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ---> macOS +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1344add --- /dev/null +++ b/LICENSE @@ -0,0 +1,163 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms +and conditions of version 3 of the GNU General Public License, supplemented +by the additional permissions listed below. + + 0. Additional Definitions. + + + +As used herein, "this License" refers to version 3 of the GNU Lesser General +Public License, and the "GNU GPL" refers to version 3 of the GNU General Public +License. + + + +"The Library" refers to a covered work governed by this License, other than +an Application or a Combined Work as defined below. + + + +An "Application" is any work that makes use of an interface provided by the +Library, but which is not otherwise based on the Library. Defining a subclass +of a class defined by the Library is deemed a mode of using an interface provided +by the Library. + + + +A "Combined Work" is a work produced by combining or linking an Application +with the Library. The particular version of the Library with which the Combined +Work was made is also called the "Linked Version". + + + +The "Minimal Corresponding Source" for a Combined Work means the Corresponding +Source for the Combined Work, excluding any source code for portions of the +Combined Work that, considered in isolation, are based on the Application, +and not on the Linked Version. + + + +The "Corresponding Application Code" for a Combined Work means the object +code and/or source code for the Application, including any data and utility +programs needed for reproducing the Combined Work from the Application, but +excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without +being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility +refers to a function or data to be supplied by an Application that uses the +facility (other than as an argument passed when the facility is invoked), +then you may convey a copy of the modified version: + +a) under this License, provided that you make a good faith effort to ensure +that, in the event an Application does not supply the function or data, the +facility still operates, and performs whatever part of its purpose remains +meaningful, or + +b) under the GNU GPL, with none of the additional permissions of this License +applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header +file that is part of the Library. You may convey such object code under terms +of your choice, provided that, if the incorporated material is not limited +to numerical parameters, data structure layouts and accessors, or small macros, +inline functions and templates (ten or fewer lines in length), you do both +of the following: + +a) Give prominent notice with each copy of the object code that the Library +is used in it and that the Library and its use are covered by this License. + +b) Accompany the object code with a copy of the GNU GPL and this license document. + + 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, +effectively do not restrict modification of the portions of the Library contained +in the Combined Work and reverse engineering for debugging such modifications, +if you also do each of the following: + +a) Give prominent notice with each copy of the Combined Work that the Library +is used in it and that the Library and its use are covered by this License. + +b) Accompany the Combined Work with a copy of the GNU GPL and this license +document. + +c) For a Combined Work that displays copyright notices during execution, include +the copyright notice for the Library among these notices, as well as a reference +directing the user to the copies of the GNU GPL and this license document. + + d) Do one of the following: + +0) Convey the Minimal Corresponding Source under the terms of this License, +and the Corresponding Application Code in a form suitable for, and under terms +that permit, the user to recombine or relink the Application with a modified +version of the Linked Version to produce a modified Combined Work, in the +manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + +1) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (a) uses at run time a copy of the Library +already present on the user's computer system, and (b) will operate properly +with a modified version of the Library that is interface-compatible with the +Linked Version. + +e) Provide Installation Information, but only if you would otherwise be required +to provide such information under section 6 of the GNU GPL, and only to the +extent that such information is necessary to install and execute a modified +version of the Combined Work produced by recombining or relinking the Application +with a modified version of the Linked Version. (If you use option 4d0, the +Installation Information must accompany the Minimal Corresponding Source and +Corresponding Application Code. If you use option 4d1, you must provide the +Installation Information in the manner specified by section 6 of the GNU GPL +for conveying Corresponding Source.) + + 5. Combined Libraries. + +You may place library facilities that are a work based on the Library side +by side in a single library together with other library facilities that are +not Applications and are not covered by this License, and convey such a combined +library under terms of your choice, if you do both of the following: + +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities, conveyed under the +terms of this License. + +b) Give prominent notice with the combined library that part of it is a work +based on the Library, and explaining where to find the accompanying uncombined +form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the +GNU Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you +received it specifies that a certain numbered version of the GNU Lesser General +Public License "or any later version" applies to it, you have the option of +following the terms and conditions either of that published version or of +any later version published by the Free Software Foundation. If the Library +as you received it does not specify a version number of the GNU Lesser General +Public License, you may choose any version of the GNU Lesser General Public +License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether +future versions of the GNU Lesser General Public License shall apply, that +proxy's public statement of acceptance of any version is permanent authorization +for you to choose that version for the Library. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b930a0 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# ensure_repo_epel + From f3cc4d64513545ebd28b79cca35ccc881a1629fe Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 30 Dec 2019 15:52:52 -0600 Subject: [PATCH 02/27] Deploy EPEL for all EL class OS --- .gitignore | 75 ++++++++++++++++++++++------------------ .travis.yml | 29 ++++++++++++++++ README.md | 38 +++++++++++++++++++- defaults/main.yml | 2 ++ handlers/main.yml | 7 ++++ meta/main.yml | 53 ++++++++++++++++++++++++++++ tasks/main.yml | 45 ++++++++++++++++++++++++ tests/inventory | 2 ++ tests/test.yml | 5 +++ vars/RedHat-6-i386.yml | 5 +++ vars/RedHat-6-x86_64.yml | 5 +++ vars/RedHat-7-x86_64.yml | 5 +++ vars/RedHat-8-x86_64.yml | 5 +++ vars/default.yml | 2 ++ vars/main.yml | 2 ++ 15 files changed, 245 insertions(+), 35 deletions(-) create mode 100644 .travis.yml create mode 100644 defaults/main.yml create mode 100644 handlers/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 create mode 100644 vars/RedHat-6-i386.yml create mode 100644 vars/RedHat-6-x86_64.yml create mode 100644 vars/RedHat-7-x86_64.yml create mode 100644 vars/RedHat-8-x86_64.yml create mode 100644 vars/default.yml create mode 100644 vars/main.yml diff --git a/.gitignore b/.gitignore index 6caeae7..ce59d0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,6 @@ # ---> Ansible *.retry -# ---> Vim -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - -# ---> Linux -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - # ---> Windows # Windows thumbnail cache files Thumbs.db @@ -88,3 +54,44 @@ Network Trash Folder Temporary Items .apdisk +# ---> Linux +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# ---> Vim +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# ---> VisualStudioCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..36bbf62 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +--- +language: python +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip + +install: + # Install ansible + - pip install ansible + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + +script: + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/README.md b/README.md index 5b930a0..1c6344a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ -# ensure_repo_epel +Role Name +========= +Ensure Repository EPEL + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +LGPL >= 3 + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..1781da7 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ensure_repo_epel \ No newline at end of file diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..fba23e3 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# handlers file for ensure_repo_epel +- name: 'ensure_repo_epel.package_facts' + package_facts: +- name: 'ensure_repo_epel.service_facts' + service_facts: + diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..6566e11 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,53 @@ +galaxy_info: + author: Jason Rothstein + description: Ensure EPEL on EL + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.9 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. + diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..58f1ce1 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,45 @@ +--- +# tasks file for ensure_repo_epel +- name: 'include variables' + when: + - ansible_system == 'Linux' + include_vars: + file: '{{ lookup("first_found", findme ) }}' + name: 'ensure_repo_epel' + vars: + findme: + files: + - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' + - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' + - '{{ ansible_distribution }}-default.yml' + - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' + - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' + - '{{ ansible_os_family }}-default.yml' + - 'default.yml' + paths: + - '../vars/' + errors: 'ignore' +- name: 'package discovery' + when: + - ansible_system == 'Linux' + - packages is not defined + package_facts: +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ensure_repo_epel is defined + - ensure_repo_epel.package_list is defined + - ensure_repo_epel.package_list is iterable + - packages[item.name] is not defined + package: + name: '{{ item.url }}' + state: '{{ item.state }}' + loop: '{{ ensure_repo_epel.package_list }}' + loop_control: + label: '{{ item.name }} from {{ item.url }} will be {{ item.state }}' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' +- name: 'flush handlers' + meta: 'flush_handlers' + diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..18381e8 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - ensure_repo_epel diff --git a/vars/RedHat-6-i386.yml b/vars/RedHat-6-i386.yml new file mode 100644 index 0000000..4c4792c --- /dev/null +++ b/vars/RedHat-6-i386.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_epel +package_list: + - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' } + diff --git a/vars/RedHat-6-x86_64.yml b/vars/RedHat-6-x86_64.yml new file mode 100644 index 0000000..4c4792c --- /dev/null +++ b/vars/RedHat-6-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_epel +package_list: + - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' } + diff --git a/vars/RedHat-7-x86_64.yml b/vars/RedHat-7-x86_64.yml new file mode 100644 index 0000000..b089d11 --- /dev/null +++ b/vars/RedHat-7-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_epel +package_list: + - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' } + diff --git a/vars/RedHat-8-x86_64.yml b/vars/RedHat-8-x86_64.yml new file mode 100644 index 0000000..7b618dc --- /dev/null +++ b/vars/RedHat-8-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_epel +package_list: + - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' } + diff --git a/vars/default.yml b/vars/default.yml new file mode 100644 index 0000000..87741af --- /dev/null +++ b/vars/default.yml @@ -0,0 +1,2 @@ +--- +# vars file for ensure_repo_epel diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..ebefd89 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for ensure_repo_epel \ No newline at end of file From 62c8c6478b44c0ea7b1e6bf481c17587cc150d77 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sat, 28 Mar 2020 17:34:59 -0500 Subject: [PATCH 03/27] Update license to be correct --- meta/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index 6566e11..899f0ac 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -14,7 +14,7 @@ galaxy_info: # - GPL-3.0-only # - Apache-2.0 # - CC-BY-4.0 - license: license (GPL-2.0-or-later, MIT, etc) + license: LGPL-3.0-or-later min_ansible_version: 2.9 From 1dd8dc5afb1247aaf0c22385307d69048e96dd18 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sat, 28 Mar 2020 17:36:22 -0500 Subject: [PATCH 04/27] Make dictionaries maintainable --- vars/RedHat-6-i386.yml | 4 +++- vars/RedHat-6-x86_64.yml | 4 +++- vars/RedHat-7-x86_64.yml | 4 +++- vars/RedHat-8-x86_64.yml | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/RedHat-6-i386.yml b/vars/RedHat-6-i386.yml index 4c4792c..f7b3c92 100644 --- a/vars/RedHat-6-i386.yml +++ b/vars/RedHat-6-i386.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_epel package_list: - - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' } + - name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' diff --git a/vars/RedHat-6-x86_64.yml b/vars/RedHat-6-x86_64.yml index 4c4792c..f7b3c92 100644 --- a/vars/RedHat-6-x86_64.yml +++ b/vars/RedHat-6-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_epel package_list: - - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' } + - name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' diff --git a/vars/RedHat-7-x86_64.yml b/vars/RedHat-7-x86_64.yml index b089d11..8ca24dd 100644 --- a/vars/RedHat-7-x86_64.yml +++ b/vars/RedHat-7-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_epel package_list: - - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' } + - name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' diff --git a/vars/RedHat-8-x86_64.yml b/vars/RedHat-8-x86_64.yml index 7b618dc..43d8877 100644 --- a/vars/RedHat-8-x86_64.yml +++ b/vars/RedHat-8-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_epel package_list: - - { name: 'epel-release', state: 'present', url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' } + - name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' From 27309a8ab26adfded5d0683d71e9f3aff796e15e Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 22 Nov 2020 15:50:07 -0600 Subject: [PATCH 05/27] Support Collections, and native epel-release packages --- handlers/main.yml | 4 ++-- tasks/main.yml | 33 ++++----------------------------- vars/RedHat-6-i386.yml | 7 ------- vars/RedHat-6-x86_64.yml | 7 ------- vars/RedHat-7-x86_64.yml | 7 ------- vars/RedHat-8-x86_64.yml | 7 ------- vars/default.yml | 2 -- 7 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 vars/RedHat-6-i386.yml delete mode 100644 vars/RedHat-6-x86_64.yml delete mode 100644 vars/RedHat-7-x86_64.yml delete mode 100644 vars/RedHat-8-x86_64.yml delete mode 100644 vars/default.yml diff --git a/handlers/main.yml b/handlers/main.yml index fba23e3..dab79d8 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,7 @@ --- # handlers file for ensure_repo_epel - name: 'ensure_repo_epel.package_facts' - package_facts: + ansible.builtin.package_facts: - name: 'ensure_repo_epel.service_facts' - service_facts: + ansible.builtin.service_facts: diff --git a/tasks/main.yml b/tasks/main.yml index 58f1ce1..56591f8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,24 +1,5 @@ --- # tasks file for ensure_repo_epel -- name: 'include variables' - when: - - ansible_system == 'Linux' - include_vars: - file: '{{ lookup("first_found", findme ) }}' - name: 'ensure_repo_epel' - vars: - findme: - files: - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' - - '{{ ansible_distribution }}-default.yml' - - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' - - '{{ ansible_os_family }}-default.yml' - - 'default.yml' - paths: - - '../vars/' - errors: 'ignore' - name: 'package discovery' when: - ansible_system == 'Linux' @@ -27,16 +8,10 @@ - name: 'ensure packages' when: - ansible_system == 'Linux' - - ensure_repo_epel is defined - - ensure_repo_epel.package_list is defined - - ensure_repo_epel.package_list is iterable - - packages[item.name] is not defined - package: - name: '{{ item.url }}' - state: '{{ item.state }}' - loop: '{{ ensure_repo_epel.package_list }}' - loop_control: - label: '{{ item.name }} from {{ item.url }} will be {{ item.state }}' + - packages['epel-release'] is not defined + ansible.builtin.package: + name: 'epel-release' + state: 'installed' notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' diff --git a/vars/RedHat-6-i386.yml b/vars/RedHat-6-i386.yml deleted file mode 100644 index f7b3c92..0000000 --- a/vars/RedHat-6-i386.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# vars file for ensure_repo_epel -package_list: - - name: 'epel-release' - state: 'present' - url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' - diff --git a/vars/RedHat-6-x86_64.yml b/vars/RedHat-6-x86_64.yml deleted file mode 100644 index f7b3c92..0000000 --- a/vars/RedHat-6-x86_64.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# vars file for ensure_repo_epel -package_list: - - name: 'epel-release' - state: 'present' - url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' - diff --git a/vars/RedHat-7-x86_64.yml b/vars/RedHat-7-x86_64.yml deleted file mode 100644 index 8ca24dd..0000000 --- a/vars/RedHat-7-x86_64.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# vars file for ensure_repo_epel -package_list: - - name: 'epel-release' - state: 'present' - url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' - diff --git a/vars/RedHat-8-x86_64.yml b/vars/RedHat-8-x86_64.yml deleted file mode 100644 index 43d8877..0000000 --- a/vars/RedHat-8-x86_64.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# vars file for ensure_repo_epel -package_list: - - name: 'epel-release' - state: 'present' - url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' - diff --git a/vars/default.yml b/vars/default.yml deleted file mode 100644 index 87741af..0000000 --- a/vars/default.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ensure_repo_epel From 09f6c8352b03fec3b72219d0b0692e6b08b70d40 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 22 Nov 2020 16:17:22 -0600 Subject: [PATCH 06/27] Enable OracleLinux to use EPEL (Different method from CentOS) --- tasks/main.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 56591f8..f3505b5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,6 +8,7 @@ - name: 'ensure packages' when: - ansible_system == 'Linux' + - ansible_distribution == 'CentOS' - packages['epel-release'] is not defined ansible.builtin.package: name: 'epel-release' @@ -15,6 +16,44 @@ notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ansible_distribution == 'Oracle' + - ansible_distribution_major_version|int == 6 + - packages['epel-release'] is not defined + ansible.builtin.package: + name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' + state: 'installed' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ansible_distribution == 'Oracle' + - ansible_distribution_major_version|int == 7 + - packages['oracle-epel-release-el7'] is not defined + ansible.builtin.package: + name: 'oracle-epel-release-el7' + state: 'installed' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' +- name: 'flush handlers' + meta: 'flush_handlers' +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ansible_distribution == 'Oracle' + - ansible_distribution_major_version|int == 8 + - packages['oracle-epel-release-el8'] is not defined + ansible.builtin.package: + name: 'oracle-epel-release-el8' + state: 'installed' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' - name: 'flush handlers' meta: 'flush_handlers' From c72d7ff9d853214ea229a45058bd6444902b2f81 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 21:34:09 -0600 Subject: [PATCH 07/27] Be specific with Oracle Linux and EPEL RPMs --- README.md | 2 +- tasks/main.yml | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c6344a..c91dac3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Including an example of how to use your role (for instance, with variables passe License ------- -LGPL >= 3 +LGPL-3.0-or-later Author Information ------------------ diff --git a/tasks/main.yml b/tasks/main.yml index f3505b5..a801a1a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,7 +4,7 @@ when: - ansible_system == 'Linux' - packages is not defined - package_facts: + ansible.builtin.package_facts: - name: 'ensure packages' when: - ansible_system == 'Linux' @@ -28,6 +28,30 @@ notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ansible_distribution == 'Oracle' + - ansible_distribution_major_version|int == 7 + - packages['epel-release'] is not defined + ansible.builtin.package: + name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' + state: 'installed' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' +- name: 'ensure packages' + when: + - ansible_system == 'Linux' + - ansible_distribution == 'Oracle' + - ansible_distribution_major_version|int == 8 + - packages['epel-release'] is not defined + ansible.builtin.package: + name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' + state: 'installed' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' - name: 'ensure packages' when: - ansible_system == 'Linux' From 59f3b848e292253f870bd0d982fc9cf53d64fe80 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 21:38:58 -0600 Subject: [PATCH 08/27] disable gpg check on rpm install from URLs --- tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index a801a1a..976a2a8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,6 +23,7 @@ - ansible_distribution_major_version|int == 6 - packages['epel-release'] is not defined ansible.builtin.package: + disable_gpg_check: 'yes' name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' state: 'installed' notify: @@ -35,6 +36,7 @@ - ansible_distribution_major_version|int == 7 - packages['epel-release'] is not defined ansible.builtin.package: + disable_gpg_check: 'yes' name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' state: 'installed' notify: @@ -47,6 +49,7 @@ - ansible_distribution_major_version|int == 8 - packages['epel-release'] is not defined ansible.builtin.package: + disable_gpg_check: 'yes' name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' state: 'installed' notify: From fd4875440f90900e80e23c09dd7c8ada082c4002 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 6 Dec 2020 19:57:08 -0600 Subject: [PATCH 09/27] Use standardized / generic method to install packages for EPEL --- tasks/main.yml | 98 ++++++++++++--------------------------- vars/CentOS-6-default.yml | 7 +++ vars/CentOS-7-default.yml | 7 +++ vars/CentOS-8-default.yml | 8 ++++ vars/default.yml | 2 + 5 files changed, 53 insertions(+), 69 deletions(-) create mode 100644 vars/CentOS-6-default.yml create mode 100644 vars/CentOS-7-default.yml create mode 100644 vars/CentOS-8-default.yml create mode 100644 vars/default.yml diff --git a/tasks/main.yml b/tasks/main.yml index 976a2a8..3c42911 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,24 @@ --- # tasks file for ensure_repo_epel +- name: 'include variables' + when: + - ansible_system == 'Linux' + include_vars: + file: '{{ lookup("first_found", findme ) }}' + name: 'ensure_repo_epel' + vars: + findme: + files: + - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' + - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' + - '{{ ansible_distribution }}-default.yml' + - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' + - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' + - '{{ ansible_os_family }}-default.yml' + - 'default.yml' + paths: + - '../vars/' + errors: 'ignore' - name: 'package discovery' when: - ansible_system == 'Linux' @@ -8,76 +27,17 @@ - name: 'ensure packages' when: - ansible_system == 'Linux' - - ansible_distribution == 'CentOS' - - packages['epel-release'] is not defined + - ensure_repo_epel is defined + - ensure_repo_epel.requirements_package_list is defined + - ensure_repo_epel.requirements_package_list is iterable + - packages[item.name] is not defined ansible.builtin.package: - name: 'epel-release' - state: 'installed' - notify: - - 'ensure_repo_epel.package_facts' - - 'ensure_repo_epel.service_facts' -- name: 'ensure packages' - when: - - ansible_system == 'Linux' - - ansible_distribution == 'Oracle' - - ansible_distribution_major_version|int == 6 - - packages['epel-release'] is not defined - ansible.builtin.package: - disable_gpg_check: 'yes' - name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm' - state: 'installed' - notify: - - 'ensure_repo_epel.package_facts' - - 'ensure_repo_epel.service_facts' -- name: 'ensure packages' - when: - - ansible_system == 'Linux' - - ansible_distribution == 'Oracle' - - ansible_distribution_major_version|int == 7 - - packages['epel-release'] is not defined - ansible.builtin.package: - disable_gpg_check: 'yes' - name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' - state: 'installed' - notify: - - 'ensure_repo_epel.package_facts' - - 'ensure_repo_epel.service_facts' -- name: 'ensure packages' - when: - - ansible_system == 'Linux' - - ansible_distribution == 'Oracle' - - ansible_distribution_major_version|int == 8 - - packages['epel-release'] is not defined - ansible.builtin.package: - disable_gpg_check: 'yes' - name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm' - state: 'installed' - notify: - - 'ensure_repo_epel.package_facts' - - 'ensure_repo_epel.service_facts' -- name: 'ensure packages' - when: - - ansible_system == 'Linux' - - ansible_distribution == 'Oracle' - - ansible_distribution_major_version|int == 7 - - packages['oracle-epel-release-el7'] is not defined - ansible.builtin.package: - name: 'oracle-epel-release-el7' - state: 'installed' - notify: - - 'ensure_repo_epel.package_facts' - - 'ensure_repo_epel.service_facts' -- name: 'flush handlers' - meta: 'flush_handlers' -- name: 'ensure packages' - when: - - ansible_system == 'Linux' - - ansible_distribution == 'Oracle' - - ansible_distribution_major_version|int == 8 - - packages['oracle-epel-release-el8'] is not defined - ansible.builtin.package: - name: 'oracle-epel-release-el8' - state: 'installed' + disable_gpg_check: '{{ item.disable_gpg_check | omit(default) }}' + name: '{{ item.url }}' + state: '{{ item.state }}' + loop: '{{ ensure_repo_epel.requirements_package_list }}' + loop_control: + label: '{{ item.name }} will be {{ item.state }}' notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' diff --git a/vars/CentOS-6-default.yml b/vars/CentOS-6-default.yml new file mode 100644 index 0000000..7160069 --- /dev/null +++ b/vars/CentOS-6-default.yml @@ -0,0 +1,7 @@ +--- +# vars file for ensure_repo_epel +package_list: + - name: 'epel-release' + state: 'present' + url: 'epel-release' + diff --git a/vars/CentOS-7-default.yml b/vars/CentOS-7-default.yml new file mode 100644 index 0000000..7160069 --- /dev/null +++ b/vars/CentOS-7-default.yml @@ -0,0 +1,7 @@ +--- +# vars file for ensure_repo_epel +package_list: + - name: 'epel-release' + state: 'present' + url: 'epel-release' + diff --git a/vars/CentOS-8-default.yml b/vars/CentOS-8-default.yml new file mode 100644 index 0000000..5813ee8 --- /dev/null +++ b/vars/CentOS-8-default.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - name: 'epel-release' + disable_gpg_check: 'yes' + state: 'present' + url: 'epel-release' + diff --git a/vars/default.yml b/vars/default.yml new file mode 100644 index 0000000..ebefd89 --- /dev/null +++ b/vars/default.yml @@ -0,0 +1,2 @@ +--- +# vars file for ensure_repo_epel \ No newline at end of file From 520c4384336750e48c09bc6778fe351799c53d75 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 6 Dec 2020 21:14:18 -0600 Subject: [PATCH 10/27] Fix syntax to be default(omit) --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 3c42911..cb03b2d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,7 +32,7 @@ - ensure_repo_epel.requirements_package_list is iterable - packages[item.name] is not defined ansible.builtin.package: - disable_gpg_check: '{{ item.disable_gpg_check | omit(default) }}' + disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}' name: '{{ item.url }}' state: '{{ item.state }}' loop: '{{ ensure_repo_epel.requirements_package_list }}' From 7cbfac9fb75e1cb41d0e0c2313510a7fa92af7bb Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 7 Dec 2020 05:55:14 -0600 Subject: [PATCH 11/27] Sort the keys --- vars/CentOS-8-default.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/CentOS-8-default.yml b/vars/CentOS-8-default.yml index 5813ee8..8e42308 100644 --- a/vars/CentOS-8-default.yml +++ b/vars/CentOS-8-default.yml @@ -1,8 +1,8 @@ --- # vars file for ensure_repo_epel package_list: - - name: 'epel-release' - disable_gpg_check: 'yes' + - disable_gpg_check: 'yes' + name: 'epel-release' state: 'present' url: 'epel-release' From 86236c17a467f6c368cac3bd09cebde5b4e2a442 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 20 Dec 2020 07:42:49 -0600 Subject: [PATCH 12/27] Do service discovery as well as package discovery --- tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index cb03b2d..b4f340b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,6 +24,11 @@ - ansible_system == 'Linux' - packages is not defined ansible.builtin.package_facts: +- name: 'service discovery' + when: + - ansible_system == 'Linux' + - services is not defined + ansible.builtin.service_facts: - name: 'ensure packages' when: - ansible_system == 'Linux' From 886d31cb7850dff5777bdb42f9ce8da9ccface83 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 25 Jul 2021 03:54:17 +0000 Subject: [PATCH 13/27] Update task list to match base template --- tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index b4f340b..7a91ef3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -46,6 +46,16 @@ notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' + ansible.builtin.service: + enabled: '{{ item.enabled }}' + name: '{{ item.name }}' + state: '{{ item.state }}' + loop: '{{ ensure_repo_epel.service_list }}' + loop_control: + label: '{{ item.name }} will be {{ item.state }}' + notify: + - 'ensure_repo_epel.package_facts' + - 'ensure_repo_epel.service_facts' - name: 'flush handlers' meta: 'flush_handlers' From 0d86887899fa7154682ef295fa51dafeb0046077 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 25 Jul 2021 04:13:50 +0000 Subject: [PATCH 14/27] Missing code... --- tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 7a91ef3..ed6bab5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -46,6 +46,12 @@ notify: - 'ensure_repo_epel.package_facts' - 'ensure_repo_epel.service_facts' +- name: 'ensure services' + when: + - ansible_system == 'Linux' + - ensure_clamav is defined + - ensure_clamav.service_list is defined + - ensure_clamav.service_list is iterable ansible.builtin.service: enabled: '{{ item.enabled }}' name: '{{ item.name }}' From aef5751b3f2577e6ae691d3b925c42f1ad46796f Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 25 Jul 2021 04:15:17 +0000 Subject: [PATCH 15/27] Correct typo --- tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ed6bab5..aebd2da 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -49,9 +49,9 @@ - name: 'ensure services' when: - ansible_system == 'Linux' - - ensure_clamav is defined - - ensure_clamav.service_list is defined - - ensure_clamav.service_list is iterable + - ensure_repo_epel is defined + - ensure_repo_epel.service_list is defined + - ensure_repo_epel.service_list is iterable ansible.builtin.service: enabled: '{{ item.enabled }}' name: '{{ item.name }}' From 831cc21cd47e9385f89db2b31130060c57e8f14a Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 5 Jun 2022 16:29:55 -0500 Subject: [PATCH 16/27] Update handlers --- handlers/main.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index dab79d8..2a958a4 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,4 +4,24 @@ ansible.builtin.package_facts: - name: 'ensure_repo_epel.service_facts' ansible.builtin.service_facts: - +- name: 'ensure_repo_epel.service_reload' + when: + - ansible_system == 'Linux' + - ansible_service_mgr == 'systemd' + - ensure_repo_epel is defined + ansible.builtin.systemd: + daemon_reload: 'yes' +- name: 'ensure_repo_epel.services' + when: + - ansible_system == 'Linux' + - ensure_repo_epel is defined + - ensure_repo_epel.service_list is defined + - ensure_repo_epel.service_list is iterable + - item.state == 'started' + ansible.builtin.service: + enabled: '{{ item.enabled }}' + name: '{{ item.name }}' + state: 'restarted' + loop: '{{ ensure_repo_epel.service_list }}' + loop_control: + label: '{{ item.name }} will be restarted' From 897ac478f821a1ce813a97ea3b0d06ede9561aa5 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 23 Apr 2023 16:41:40 -0500 Subject: [PATCH 17/27] Add CentOS 9 --- vars/CentOS-9-default.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 vars/CentOS-9-default.yml diff --git a/vars/CentOS-9-default.yml b/vars/CentOS-9-default.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/CentOS-9-default.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + From 8027ac05cd671d5446ddb447d15c5aaa889dfc99 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 30 Jun 2024 19:18:34 -0500 Subject: [PATCH 18/27] Enable EPEL for Alma/Oracle/Rocky 9 Signed-off-by: Jason Rothstein --- vars/AlmaLinux-9-defualt.yml | 8 ++++++++ vars/OracleLinux-9-defualt.yml | 16 ++++++++++++++++ vars/Rocky-9-default.yml | 8 ++++++++ 3 files changed, 32 insertions(+) create mode 100644 vars/AlmaLinux-9-defualt.yml create mode 100644 vars/OracleLinux-9-defualt.yml create mode 100644 vars/Rocky-9-default.yml diff --git a/vars/AlmaLinux-9-defualt.yml b/vars/AlmaLinux-9-defualt.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/AlmaLinux-9-defualt.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + diff --git a/vars/OracleLinux-9-defualt.yml b/vars/OracleLinux-9-defualt.yml new file mode 100644 index 0000000..cdf47c4 --- /dev/null +++ b/vars/OracleLinux-9-defualt.yml @@ -0,0 +1,16 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'oracle-epel-release-el9' + state: 'present' + url: 'oracle-epel-release-el9' + - disable_gpg_check: 'yes' + name: 'oraclelinux-develer-release-el9' + state: 'present' + url: 'oraclelinux-develer-release-el9' + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm' + diff --git a/vars/Rocky-9-default.yml b/vars/Rocky-9-default.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/Rocky-9-default.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + From 974a3d12164f99a35d7599a8740d99368a5d59c8 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 25 May 2025 20:12:59 -0500 Subject: [PATCH 19/27] Hanlder improvements Signed-off-by: Jason Rothstein --- handlers/main.yml | 4 +++- tasks/main.yml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index 2a958a4..4f76005 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -11,7 +11,7 @@ - ensure_repo_epel is defined ansible.builtin.systemd: daemon_reload: 'yes' -- name: 'ensure_repo_epel.services' +- name: 'ensure_repo_epel.service_restart' when: - ansible_system == 'Linux' - ensure_repo_epel is defined @@ -25,3 +25,5 @@ loop: '{{ ensure_repo_epel.service_list }}' loop_control: label: '{{ item.name }} will be restarted' +... + diff --git a/tasks/main.yml b/tasks/main.yml index aebd2da..5f7236c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -64,4 +64,5 @@ - 'ensure_repo_epel.service_facts' - name: 'flush handlers' meta: 'flush_handlers' +... From 66d4614a906358295cb492923192344cff871b38 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Thu, 30 Apr 2026 19:40:22 -0500 Subject: [PATCH 20/27] Fix OL9, add Alma, CentOS, Oracle, and Rocky 10 Signed-off-by: Jason Rothstein --- vars/AlmaLinux-10-defualt.yml | 8 ++++++++ vars/CentOS-10-default.yml | 8 ++++++++ vars/OracleLinux-10-defualt.yml | 16 ++++++++++++++++ vars/OracleLinux-9-defualt.yml | 4 ++-- vars/Rocky-10-default.yml | 8 ++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 vars/AlmaLinux-10-defualt.yml create mode 100644 vars/CentOS-10-default.yml create mode 100644 vars/OracleLinux-10-defualt.yml create mode 100644 vars/Rocky-10-default.yml diff --git a/vars/AlmaLinux-10-defualt.yml b/vars/AlmaLinux-10-defualt.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/AlmaLinux-10-defualt.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + diff --git a/vars/CentOS-10-default.yml b/vars/CentOS-10-default.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/CentOS-10-default.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + diff --git a/vars/OracleLinux-10-defualt.yml b/vars/OracleLinux-10-defualt.yml new file mode 100644 index 0000000..82ac6cd --- /dev/null +++ b/vars/OracleLinux-10-defualt.yml @@ -0,0 +1,16 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'oracle-epel-release-el10' + state: 'present' + url: 'oracle-epel-release-el10' + - disable_gpg_check: 'yes' + name: 'oraclelinux-developer-release-el10' + state: 'present' + url: 'oraclelinux-developer-release-el10' + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm' + diff --git a/vars/OracleLinux-9-defualt.yml b/vars/OracleLinux-9-defualt.yml index cdf47c4..92bae84 100644 --- a/vars/OracleLinux-9-defualt.yml +++ b/vars/OracleLinux-9-defualt.yml @@ -6,9 +6,9 @@ package_list: state: 'present' url: 'oracle-epel-release-el9' - disable_gpg_check: 'yes' - name: 'oraclelinux-develer-release-el9' + name: 'oraclelinux-developer-release-el9' state: 'present' - url: 'oraclelinux-develer-release-el9' + url: 'oraclelinux-developer-release-el9' - disable_gpg_check: 'yes' name: 'epel-release' state: 'present' diff --git a/vars/Rocky-10-default.yml b/vars/Rocky-10-default.yml new file mode 100644 index 0000000..8e42308 --- /dev/null +++ b/vars/Rocky-10-default.yml @@ -0,0 +1,8 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'epel-release' + From d52ede16fb9ec490b92ce87e2b7b7fbdc6e2fe99 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sat, 2 May 2026 23:49:41 -0500 Subject: [PATCH 21/27] Fix Alma and Oracle 9 and 10 spelling Signed-off-by: Jason Rothstein --- vars/{AlmaLinux-10-defualt.yml => AlmaLinux-10-default.yml} | 0 vars/{AlmaLinux-9-defualt.yml => AlmaLinux-9-default.yml} | 0 vars/{OracleLinux-10-defualt.yml => OracleLinux-10-default.yml} | 0 vars/{OracleLinux-9-defualt.yml => OracleLinux-9-default.yml} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename vars/{AlmaLinux-10-defualt.yml => AlmaLinux-10-default.yml} (100%) rename vars/{AlmaLinux-9-defualt.yml => AlmaLinux-9-default.yml} (100%) rename vars/{OracleLinux-10-defualt.yml => OracleLinux-10-default.yml} (100%) rename vars/{OracleLinux-9-defualt.yml => OracleLinux-9-default.yml} (100%) diff --git a/vars/AlmaLinux-10-defualt.yml b/vars/AlmaLinux-10-default.yml similarity index 100% rename from vars/AlmaLinux-10-defualt.yml rename to vars/AlmaLinux-10-default.yml diff --git a/vars/AlmaLinux-9-defualt.yml b/vars/AlmaLinux-9-default.yml similarity index 100% rename from vars/AlmaLinux-9-defualt.yml rename to vars/AlmaLinux-9-default.yml diff --git a/vars/OracleLinux-10-defualt.yml b/vars/OracleLinux-10-default.yml similarity index 100% rename from vars/OracleLinux-10-defualt.yml rename to vars/OracleLinux-10-default.yml diff --git a/vars/OracleLinux-9-defualt.yml b/vars/OracleLinux-9-default.yml similarity index 100% rename from vars/OracleLinux-9-defualt.yml rename to vars/OracleLinux-9-default.yml From 059e196640b90b85a2d124634893135ab0cb4529 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 3 May 2026 01:03:04 -0500 Subject: [PATCH 22/27] Fix package_list variable name Signed-off-by: Jason Rothstein --- tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 5f7236c..b477b4c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -33,14 +33,14 @@ when: - ansible_system == 'Linux' - ensure_repo_epel is defined - - ensure_repo_epel.requirements_package_list is defined - - ensure_repo_epel.requirements_package_list is iterable + - ensure_repo_epel.package_list is defined + - ensure_repo_epel.package_list is iterable - packages[item.name] is not defined ansible.builtin.package: disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}' name: '{{ item.url }}' state: '{{ item.state }}' - loop: '{{ ensure_repo_epel.requirements_package_list }}' + loop: '{{ ensure_repo_epel.package_list }}' loop_control: label: '{{ item.name }} will be {{ item.state }}' notify: From d5f19143df21dd80d09f47627e6049d6c2991720 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Tue, 5 May 2026 14:06:42 -0500 Subject: [PATCH 23/27] Ansible Core 2.20 fixes and Supported OS fixes Signed-off-by: Jason Rothstein --- tasks/main.yml | 22 +++++++++---------- ...-6-default.yml => AlmaLinux-8-default.yml} | 3 ++- vars/OracleLinux-8-default.yml | 16 ++++++++++++++ ...ntOS-7-default.yml => Rocky-8-default.yml} | 3 ++- 4 files changed, 31 insertions(+), 13 deletions(-) rename vars/{CentOS-6-default.yml => AlmaLinux-8-default.yml} (64%) create mode 100644 vars/OracleLinux-8-default.yml rename vars/{CentOS-7-default.yml => Rocky-8-default.yml} (64%) diff --git a/tasks/main.yml b/tasks/main.yml index b477b4c..beefdbf 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,18 +2,18 @@ # tasks file for ensure_repo_epel - name: 'include variables' when: - - ansible_system == 'Linux' + - ansible_facts["system"] == 'Linux' include_vars: file: '{{ lookup("first_found", findme ) }}' name: 'ensure_repo_epel' vars: findme: files: - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' - - '{{ ansible_distribution }}-default.yml' - - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' + - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml' + - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' + - '{{ ansible_facts["distribution"] }}-default.yml' + - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml' + - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' - '{{ ansible_os_family }}-default.yml' - 'default.yml' paths: @@ -21,17 +21,17 @@ errors: 'ignore' - name: 'package discovery' when: - - ansible_system == 'Linux' - - packages is not defined + - ansible_facts["system"] == 'Linux' + - ansible_facts["packages"] is not defined ansible.builtin.package_facts: - name: 'service discovery' when: - - ansible_system == 'Linux' + - ansible_facts["system"] == 'Linux' - services is not defined ansible.builtin.service_facts: - name: 'ensure packages' when: - - ansible_system == 'Linux' + - ansible_facts["system"] == 'Linux' - ensure_repo_epel is defined - ensure_repo_epel.package_list is defined - ensure_repo_epel.package_list is iterable @@ -48,7 +48,7 @@ - 'ensure_repo_epel.service_facts' - name: 'ensure services' when: - - ansible_system == 'Linux' + - ansible_facts["system"] == 'Linux' - ensure_repo_epel is defined - ensure_repo_epel.service_list is defined - ensure_repo_epel.service_list is iterable diff --git a/vars/CentOS-6-default.yml b/vars/AlmaLinux-8-default.yml similarity index 64% rename from vars/CentOS-6-default.yml rename to vars/AlmaLinux-8-default.yml index 7160069..8e42308 100644 --- a/vars/CentOS-6-default.yml +++ b/vars/AlmaLinux-8-default.yml @@ -1,7 +1,8 @@ --- # vars file for ensure_repo_epel package_list: - - name: 'epel-release' + - disable_gpg_check: 'yes' + name: 'epel-release' state: 'present' url: 'epel-release' diff --git a/vars/OracleLinux-8-default.yml b/vars/OracleLinux-8-default.yml new file mode 100644 index 0000000..92bae84 --- /dev/null +++ b/vars/OracleLinux-8-default.yml @@ -0,0 +1,16 @@ +--- +# vars file for ensure_repo_epel +package_list: + - disable_gpg_check: 'yes' + name: 'oracle-epel-release-el9' + state: 'present' + url: 'oracle-epel-release-el9' + - disable_gpg_check: 'yes' + name: 'oraclelinux-developer-release-el9' + state: 'present' + url: 'oraclelinux-developer-release-el9' + - disable_gpg_check: 'yes' + name: 'epel-release' + state: 'present' + url: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm' + diff --git a/vars/CentOS-7-default.yml b/vars/Rocky-8-default.yml similarity index 64% rename from vars/CentOS-7-default.yml rename to vars/Rocky-8-default.yml index 7160069..8e42308 100644 --- a/vars/CentOS-7-default.yml +++ b/vars/Rocky-8-default.yml @@ -1,7 +1,8 @@ --- # vars file for ensure_repo_epel package_list: - - name: 'epel-release' + - disable_gpg_check: 'yes' + name: 'epel-release' state: 'present' url: 'epel-release' From 01fd1164f155c3a81a9711536e3380a27382dddb Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Tue, 5 May 2026 15:01:52 -0500 Subject: [PATCH 24/27] More ansible core 2.20 fixes Signed-off-by: Jason Rothstein --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index beefdbf..f520bb0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,10 +9,10 @@ vars: findme: files: - - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml' + - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' - '{{ ansible_facts["distribution"] }}-default.yml' - - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml' + - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' - '{{ ansible_os_family }}-default.yml' - 'default.yml' From 77673cda04c75b9277ec0573e4fd5c2c2627ec3c Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Tue, 5 May 2026 18:16:40 -0500 Subject: [PATCH 25/27] More ansible core 2.20 fixes Signed-off-by: Jason Rothstein --- handlers/main.yml | 6 +++--- tasks/main.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 4f76005..c19bb4c 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,14 +6,14 @@ ansible.builtin.service_facts: - name: 'ensure_repo_epel.service_reload' when: - - ansible_system == 'Linux' - - ansible_service_mgr == 'systemd' + - ansible_facts["system"] == 'Linux' + - ansible_facts["service_mgr"] == 'systemd' - ensure_repo_epel is defined ansible.builtin.systemd: daemon_reload: 'yes' - name: 'ensure_repo_epel.service_restart' when: - - ansible_system == 'Linux' + - ansible_facts["system"] == 'Linux' - ensure_repo_epel is defined - ensure_repo_epel.service_list is defined - ensure_repo_epel.service_list is iterable diff --git a/tasks/main.yml b/tasks/main.yml index f520bb0..36e8fbd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,9 +12,9 @@ - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' - '{{ ansible_facts["distribution"] }}-default.yml' - - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' - - '{{ ansible_os_family }}-default.yml' + - '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' + - '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' + - '{{ ansible_facts["os_family"] }}-default.yml' - 'default.yml' paths: - '../vars/' @@ -27,7 +27,7 @@ - name: 'service discovery' when: - ansible_facts["system"] == 'Linux' - - services is not defined + - ansible_facts["services"] is not defined ansible.builtin.service_facts: - name: 'ensure packages' when: From 9a0c1a47ac416318144d47256dfab8690783081f Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Tue, 5 May 2026 22:45:09 -0500 Subject: [PATCH 26/27] More ansible core 2.20 fixes Signed-off-by: Jason Rothstein --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 36e8fbd..618a7ec 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,7 +35,7 @@ - ensure_repo_epel is defined - ensure_repo_epel.package_list is defined - ensure_repo_epel.package_list is iterable - - packages[item.name] is not defined + - ansible_facts.packages.[item.name] is not defined ansible.builtin.package: disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}' name: '{{ item.url }}' From 0ef76f1fa7a7d58641857b0e382aedf56c2b3cd8 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Tue, 5 May 2026 22:47:24 -0500 Subject: [PATCH 27/27] Syntax fix Signed-off-by: Jason Rothstein --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 618a7ec..8629886 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,7 +35,7 @@ - ensure_repo_epel is defined - ensure_repo_epel.package_list is defined - ensure_repo_epel.package_list is iterable - - ansible_facts.packages.[item.name] is not defined + - ansible_facts.packages[item.name] is not defined ansible.builtin.package: disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}' name: '{{ item.url }}'