From 7cc1215f46f54ded791393d4d106fc3532e10905 Mon Sep 17 00:00:00 2001 From: AnsibleRoles <> Date: Mon, 30 Dec 2019 21:37:29 +0000 Subject: [PATCH 01/15] 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..53a677e --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# ensure_repo_fdragon + From 300b813bce1f5af018eeab3d7789f5c8d4f05059 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 30 Dec 2019 20:23:51 -0600 Subject: [PATCH 02/15] Enable Fedora 30+ and EPEL 6+ support --- .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/Fedora-30-x86_64.yml | 5 +++ vars/Fedora-31-x86_64.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 ++ 17 files changed, 255 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/Fedora-30-x86_64.yml create mode 100644 vars/Fedora-31-x86_64.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 53a677e..785b9a1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ -# ensure_repo_fdragon +Role Name +========= +Deploy fdragon repo for EL/Fedora + +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..f00dc5b --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ensure_repo_fdragon \ No newline at end of file diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..4ecd87e --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# handlers file for ensure_repo_fdragon +- name: 'ensure_repo_fdragon.package_facts' + package_facts: +- name: 'ensure_repo_fdragon.service_facts' + service_facts: + diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..227ad9c --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,53 @@ +galaxy_info: + author: your name + description: your role description + 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. + \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..4e5f4c1 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,45 @@ +--- +# tasks file for ensure_repo_fdragon +- name: 'include variables' + when: + - ansible_system == 'Linux' + include_vars: + file: '{{ lookup("first_found", findme ) }}' + name: 'ensure_repo_fdragon' + 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_fdragon is defined + - ensure_repo_fdragon.package_list is defined + - ensure_repo_fdragon.package_list is iterable + - packages[item.name] is not defined + package: + name: '{{ item.name }}' + state: '{{ item.state }}' + loop: '{{ ensure_repo_fdragon.package_list }}' + loop_control: + label: '{{ item.name }} will be {{ item.state }}' + notify: + - 'ensure_repo_fdragon.package_facts' + - 'ensure_repo_fdragon.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..df6e16e --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - ensure_repo_fdragon \ No newline at end of file diff --git a/vars/Fedora-30-x86_64.yml b/vars/Fedora-30-x86_64.yml new file mode 100644 index 0000000..5132bcf --- /dev/null +++ b/vars/Fedora-30-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/fedora/30/x86_64/fdragon-release-2019.11.02-1.fc30.x86_64.rpm' } + diff --git a/vars/Fedora-31-x86_64.yml b/vars/Fedora-31-x86_64.yml new file mode 100644 index 0000000..3196354 --- /dev/null +++ b/vars/Fedora-31-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/fedora/31/x86_64/fdragon-release-2019.11.02-1.fc31.x86_64.rpm' } + diff --git a/vars/RedHat-6-i386.yml b/vars/RedHat-6-i386.yml new file mode 100644 index 0000000..bf011c6 --- /dev/null +++ b/vars/RedHat-6-i386.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/6/i386/fdragon-release-2019.11.02-1.el6.i686.rpm' } + diff --git a/vars/RedHat-6-x86_64.yml b/vars/RedHat-6-x86_64.yml new file mode 100644 index 0000000..bd1bf45 --- /dev/null +++ b/vars/RedHat-6-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/6/x86_64/fdragon-release-2019.11.02-1.el6.x86_64.rpm' } + diff --git a/vars/RedHat-7-x86_64.yml b/vars/RedHat-7-x86_64.yml new file mode 100644 index 0000000..5526230 --- /dev/null +++ b/vars/RedHat-7-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/7/x86_64/fdragon-release-2019.11.02-1.el7.x86_64.rpm' } + diff --git a/vars/RedHat-8-x86_64.yml b/vars/RedHat-8-x86_64.yml new file mode 100644 index 0000000..01fb308 --- /dev/null +++ b/vars/RedHat-8-x86_64.yml @@ -0,0 +1,5 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/8/x86_64/fdragon-release-2019.11.02-1.el8.x86_64.rpm' } + diff --git a/vars/default.yml b/vars/default.yml new file mode 100644 index 0000000..e438029 --- /dev/null +++ b/vars/default.yml @@ -0,0 +1,2 @@ +--- +# vars file for ensure_repo_fdragon \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..e438029 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for ensure_repo_fdragon \ No newline at end of file From e9f095bee42fb13960d2af172dfca0ac12f8ec44 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 30 Dec 2019 20:29:55 -0600 Subject: [PATCH 03/15] Install by URL not name --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 4e5f4c1..f6fa978 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,7 +32,7 @@ - ensure_repo_fdragon.package_list is iterable - packages[item.name] is not defined package: - name: '{{ item.name }}' + name: '{{ item.url }}' state: '{{ item.state }}' loop: '{{ ensure_repo_fdragon.package_list }}' loop_control: From 72556f63b44522b499410413cad2d9658efbd482 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sat, 28 Mar 2020 17:42:13 -0500 Subject: [PATCH 04/15] update galaxy metadat --- meta/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 227ad9c..8221e6d 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,6 @@ galaxy_info: - author: your name - description: your role description + author: Jason Rothstein + description: Deploy personal repository company: your company (optional) # If the issue tracker for your role is not on github, uncomment the @@ -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 b94193e0bcbef610d4a61892a30d05f90d16cefd Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sat, 28 Mar 2020 17:44:10 -0500 Subject: [PATCH 05/15] Make dictionaries maintainable --- vars/Fedora-30-x86_64.yml | 4 +++- vars/Fedora-31-x86_64.yml | 4 +++- 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 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/vars/Fedora-30-x86_64.yml b/vars/Fedora-30-x86_64.yml index 5132bcf..9e4c05b 100644 --- a/vars/Fedora-30-x86_64.yml +++ b/vars/Fedora-30-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/fedora/30/x86_64/fdragon-release-2019.11.02-1.fc30.x86_64.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/fedora/30/x86_64/fdragon-release-2019.11.02-1.fc30.x86_64.rpm' diff --git a/vars/Fedora-31-x86_64.yml b/vars/Fedora-31-x86_64.yml index 3196354..757fd8d 100644 --- a/vars/Fedora-31-x86_64.yml +++ b/vars/Fedora-31-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/fedora/31/x86_64/fdragon-release-2019.11.02-1.fc31.x86_64.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/fedora/31/x86_64/fdragon-release-2019.11.02-1.fc31.x86_64.rpm' diff --git a/vars/RedHat-6-i386.yml b/vars/RedHat-6-i386.yml index bf011c6..e2bf385 100644 --- a/vars/RedHat-6-i386.yml +++ b/vars/RedHat-6-i386.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/6/i386/fdragon-release-2019.11.02-1.el6.i686.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/epel/6/i386/fdragon-release-2019.11.02-1.el6.i686.rpm' diff --git a/vars/RedHat-6-x86_64.yml b/vars/RedHat-6-x86_64.yml index bd1bf45..16160be 100644 --- a/vars/RedHat-6-x86_64.yml +++ b/vars/RedHat-6-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/6/x86_64/fdragon-release-2019.11.02-1.el6.x86_64.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/epel/6/x86_64/fdragon-release-2019.11.02-1.el6.x86_64.rpm' diff --git a/vars/RedHat-7-x86_64.yml b/vars/RedHat-7-x86_64.yml index 5526230..92b33fa 100644 --- a/vars/RedHat-7-x86_64.yml +++ b/vars/RedHat-7-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/7/x86_64/fdragon-release-2019.11.02-1.el7.x86_64.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/epel/7/x86_64/fdragon-release-2019.11.02-1.el7.x86_64.rpm' diff --git a/vars/RedHat-8-x86_64.yml b/vars/RedHat-8-x86_64.yml index 01fb308..fa08c4e 100644 --- a/vars/RedHat-8-x86_64.yml +++ b/vars/RedHat-8-x86_64.yml @@ -1,5 +1,7 @@ --- # vars file for ensure_repo_fdragon package_list: - - { name: 'fdragon-release', state: 'present', url: 'https://fdragon.org/packages/epel/8/x86_64/fdragon-release-2019.11.02-1.el8.x86_64.rpm' } + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/epel/8/x86_64/fdragon-release-2019.11.02-1.el8.x86_64.rpm' From 3b3002836b25ea784d3dffbb8f60afc05d777d4d Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 21:42:28 -0600 Subject: [PATCH 06/15] Add Fedora 32 support --- vars/Fedora-32-x86_64.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vars/Fedora-32-x86_64.yml diff --git a/vars/Fedora-32-x86_64.yml b/vars/Fedora-32-x86_64.yml new file mode 100644 index 0000000..592ccef --- /dev/null +++ b/vars/Fedora-32-x86_64.yml @@ -0,0 +1,7 @@ +--- +# vars file for ensure_repo_fdragon +package_list: + - name: 'fdragon-release' + state: 'present' + url: 'https://fdragon.org/packages/fedora/32/x86_64/fdragon-release-2020.03.28-1.fc32.x86_64.rpm' + From f354c1e656a677d9e18bc2a4037bfb56e018a6a1 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 21:42:47 -0600 Subject: [PATCH 07/15] Be specific about the supported EL release --- vars/{RedHat-6-i386.yml => CentOS-6-i386.yml} | 0 vars/{RedHat-6-x86_64.yml => CentOS-6-x86_64.yml} | 0 vars/{RedHat-7-x86_64.yml => CentOS-7-x86_64.yml} | 0 vars/{RedHat-8-x86_64.yml => CentOS-8-x86_64.yml} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename vars/{RedHat-6-i386.yml => CentOS-6-i386.yml} (100%) rename vars/{RedHat-6-x86_64.yml => CentOS-6-x86_64.yml} (100%) rename vars/{RedHat-7-x86_64.yml => CentOS-7-x86_64.yml} (100%) rename vars/{RedHat-8-x86_64.yml => CentOS-8-x86_64.yml} (100%) diff --git a/vars/RedHat-6-i386.yml b/vars/CentOS-6-i386.yml similarity index 100% rename from vars/RedHat-6-i386.yml rename to vars/CentOS-6-i386.yml diff --git a/vars/RedHat-6-x86_64.yml b/vars/CentOS-6-x86_64.yml similarity index 100% rename from vars/RedHat-6-x86_64.yml rename to vars/CentOS-6-x86_64.yml diff --git a/vars/RedHat-7-x86_64.yml b/vars/CentOS-7-x86_64.yml similarity index 100% rename from vars/RedHat-7-x86_64.yml rename to vars/CentOS-7-x86_64.yml diff --git a/vars/RedHat-8-x86_64.yml b/vars/CentOS-8-x86_64.yml similarity index 100% rename from vars/RedHat-8-x86_64.yml rename to vars/CentOS-8-x86_64.yml From d48a78b641118a99f3e076d319841d7554970443 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 21:44:30 -0600 Subject: [PATCH 08/15] Use Ansible FQCN --- README.md | 2 +- handlers/main.yml | 4 ++-- tasks/main.yml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 785b9a1..2c2e81c 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/handlers/main.yml b/handlers/main.yml index 4ecd87e..d96870d 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,7 @@ --- # handlers file for ensure_repo_fdragon - name: 'ensure_repo_fdragon.package_facts' - package_facts: + ansible.builtin.package_facts: - name: 'ensure_repo_fdragon.service_facts' - service_facts: + ansible.builtin.service_facts: diff --git a/tasks/main.yml b/tasks/main.yml index f6fa978..adf253f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,7 +23,7 @@ when: - ansible_system == 'Linux' - packages is not defined - package_facts: + ansible.builtin.package_facts: - name: 'ensure packages' when: - ansible_system == 'Linux' @@ -31,7 +31,8 @@ - ensure_repo_fdragon.package_list is defined - ensure_repo_fdragon.package_list is iterable - packages[item.name] is not defined - package: + ansible.builtin.package: + disable_gpg_check: 'yes' name: '{{ item.url }}' state: '{{ item.state }}' loop: '{{ ensure_repo_fdragon.package_list }}' From 0c4d5bf209b64d9f3b6cc727e63df8474a08016b Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 6 Dec 2020 21:15:06 -0600 Subject: [PATCH 09/15] 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 adf253f..625621d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,7 +32,7 @@ - ensure_repo_fdragon.package_list is iterable - packages[item.name] is not defined ansible.builtin.package: - disable_gpg_check: 'yes' + disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}' name: '{{ item.url }}' state: '{{ item.state }}' loop: '{{ ensure_repo_fdragon.package_list }}' From a825f3e0969b2e9ddc6c99a411d1001ad58e09b1 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 7 Dec 2020 05:55:42 -0600 Subject: [PATCH 10/15] Disable GPG check for repo install --- vars/CentOS-8-x86_64.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vars/CentOS-8-x86_64.yml b/vars/CentOS-8-x86_64.yml index fa08c4e..c48e3ff 100644 --- a/vars/CentOS-8-x86_64.yml +++ b/vars/CentOS-8-x86_64.yml @@ -1,7 +1,8 @@ --- # vars file for ensure_repo_fdragon package_list: - - name: 'fdragon-release' + - disable_gpg_check: 'yes' + name: 'fdragon-release' state: 'present' url: 'https://fdragon.org/packages/epel/8/x86_64/fdragon-release-2019.11.02-1.el8.x86_64.rpm' From 0a63566b93201cd857a6b2dc0c257c1823a2e2eb Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 7 Dec 2020 05:57:44 -0600 Subject: [PATCH 11/15] Disable GPG key check for Fedora 32 install --- vars/Fedora-32-x86_64.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vars/Fedora-32-x86_64.yml b/vars/Fedora-32-x86_64.yml index 592ccef..f68b063 100644 --- a/vars/Fedora-32-x86_64.yml +++ b/vars/Fedora-32-x86_64.yml @@ -1,7 +1,8 @@ --- # vars file for ensure_repo_fdragon package_list: - - name: 'fdragon-release' + - disable_gpg_check: 'yes' + name: 'fdragon-release' state: 'present' url: 'https://fdragon.org/packages/fedora/32/x86_64/fdragon-release-2020.03.28-1.fc32.x86_64.rpm' From 6c0051bf5cdbb5535c03f666c0e3d07c7316cb73 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 20 Dec 2020 07:43:19 -0600 Subject: [PATCH 12/15] 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 625621d..72d58ef 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 d53957d9d3be0ea01e0a6752fa9a0cec72b016c7 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 5 Jun 2022 16:30:01 -0500 Subject: [PATCH 13/15] Update handlers --- handlers/main.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index d96870d..b7a9777 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,4 +4,24 @@ ansible.builtin.package_facts: - name: 'ensure_repo_fdragon.service_facts' ansible.builtin.service_facts: - +- name: 'ensure_repo_fdragon.service_reload' + when: + - ansible_system == 'Linux' + - ansible_service_mgr == 'systemd' + - ensure_repo_fdragon is defined + ansible.builtin.systemd: + daemon_reload: 'yes' +- name: 'ensure_repo_fdragon.services' + when: + - ansible_system == 'Linux' + - ensure_repo_fdragon is defined + - ensure_repo_fdragon.service_list is defined + - ensure_repo_fdragon.service_list is iterable + - item.state == 'started' + ansible.builtin.service: + enabled: '{{ item.enabled }}' + name: '{{ item.name }}' + state: 'restarted' + loop: '{{ ensure_repo_fdragon.service_list }}' + loop_control: + label: '{{ item.name }} will be restarted' From 44539912ba2a5843a8e84d483e4b3e045e7e697c Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 5 Jun 2022 16:48:35 -0500 Subject: [PATCH 14/15] Update tasks --- tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 72d58ef..4f194a4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -46,6 +46,16 @@ notify: - 'ensure_repo_fdragon.package_facts' - 'ensure_repo_fdragon.service_facts' + ansible.builtin.service: + enabled: '{{ item.enabled }}' + name: '{{ item.name }}' + state: '{{ item.state }}' + loop: '{{ ensure_repo_fdragon.service_list }}' + loop_control: + label: '{{ item.name }} will be {{ item.state }}' + notify: + - 'ensure_repo_fdragon.package_facts' + - 'ensure_repo_fdragon.service_facts' - name: 'flush handlers' meta: 'flush_handlers' From b1a07a88f4867f8e27e97c42fc960c69b18f3c61 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 25 May 2025 20:13:13 -0500 Subject: [PATCH 15/15] 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 b7a9777..ba70375 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -11,7 +11,7 @@ - ensure_repo_fdragon is defined ansible.builtin.systemd: daemon_reload: 'yes' -- name: 'ensure_repo_fdragon.services' +- name: 'ensure_repo_fdragon.service_restart' when: - ansible_system == 'Linux' - ensure_repo_fdragon is defined @@ -25,3 +25,5 @@ loop: '{{ ensure_repo_fdragon.service_list }}' loop_control: label: '{{ item.name }} will be restarted' +... + diff --git a/tasks/main.yml b/tasks/main.yml index 4f194a4..a8c623e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -58,4 +58,5 @@ - 'ensure_repo_fdragon.service_facts' - name: 'flush handlers' meta: 'flush_handlers' +...