From f40faba4d47b02bdcb5da7d27796871583ef79c6 Mon Sep 17 00:00:00 2001 From: Mike Holmes Date: Mon, 4 Nov 2019 21:45:41 -0600 Subject: [PATCH 1/3] initial commit --- README.md | 38 +++++++++++++++++++++++++- defaults/main.yml | 4 +++ files/rpm_gpg_key_epel_7 | 30 ++++++++++++++++++++ files/rpm_gpg_key_gitlab | 54 ++++++++++++++++++++++++++++++++++++ handlers/main.yml | 2 ++ meta/main.yml | 53 ++++++++++++++++++++++++++++++++++++ tasks/custom_content.yml | 29 ++++++++++++++++++++ tasks/main.yml | 7 +++++ tasks/repo_create.yml | 59 ++++++++++++++++++++++++++++++++++++++++ tests/inventory | 2 ++ tests/test.yml | 5 ++++ vars/main.yml | 2 ++ 12 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 defaults/main.yml create mode 100644 files/rpm_gpg_key_epel_7 create mode 100644 files/rpm_gpg_key_gitlab create mode 100644 handlers/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/custom_content.yml create mode 100644 tasks/main.yml create mode 100644 tasks/repo_create.yml create mode 100644 tests/inventory create mode 100644 tests/test.yml create mode 100644 vars/main.yml diff --git a/README.md b/README.md index 0e44c1b..225dd44 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ -# 3rd_party_repos_satellite +Role Name +========= +A brief description of the role goes here. + +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 +------- + +BSD + +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..3f31d8a --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,4 @@ +--- +# defaults file for 3rd_party_repos_satellite +foreman_initial_organization: "{{ lookup('env','FOREMAN_INITIAL_ORGANIZATION') }}" +foreman_initial_location: "{{ lookup('env','FOREMAN_INITIAL_LOCATION') }}" diff --git a/files/rpm_gpg_key_epel_7 b/files/rpm_gpg_key_epel_7 new file mode 100644 index 0000000..ea929f9 --- /dev/null +++ b/files/rpm_gpg_key_epel_7 @@ -0,0 +1,30 @@ +----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.11 (GNU/Linux) + +mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB +OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm +jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP +vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM +jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 +S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ +n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB +9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 +T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj +GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf +uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB +tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB +AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk +5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q +ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu +MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re +9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax +CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv +HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB +VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q +thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc +ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 +vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt +RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== +=hdPa +-----END PGP PUBLIC KEY BLOCK----- + diff --git a/files/rpm_gpg_key_gitlab b/files/rpm_gpg_key_gitlab new file mode 100644 index 0000000..b1829f6 --- /dev/null +++ b/files/rpm_gpg_key_gitlab @@ -0,0 +1,54 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuP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njFbjdbhef8SvNexlspjrzL9rk3AIX1 +osWJQNEJJBZvhfO5sTbzzMG9vUYpx+AUUiePnHkaX+aeSfDpBU3QYBaUyQVOHB3U +2EeLT9S4qmb7v70jL+kZJ1ydSiD6IDMr+GTjS9dqSwInvcHL1yDZ3KaD4UEApxd9 +czSUY9UAEQEAAYkCPAQYAQgAJhYhBDAYOsLE4jpAnvvnBZzkWryIByHUBQJbK987 +AhsMBQkCF1eXAAoJEJzkWryIByHU9p0QAOFU5NhdCAHgINNWtalxJuPuCS/sa29+ +AXQWyoQa3Q/zO2C8xb8VhGBonDgfWWmrsh9qIMDxktWfxRHaCCHGaHT0guI7Nbd7 +7bTIk+R0jWuhTmbJZlFw23qPKw/GTOvq3C2KbMPbHYUtcJ/cUM63x1BRiYyFRnvq +RQsZlx9x1V6c6DCCjwfFQMZEFAuFZEr2CNECXboMVsBngyoM/Omb3acbvtgzAtPZ +qwCMxzS+IlwNZVbxm/l61DJsav6hFvv5SCS+JYDs/iMTPBNQkuiFutkK79IkhSTW +TtwCq6UiWu262zOfGHTxWtlwL9HcwKR9lcUUy+X3ewx2G2zugJ7OywOrgjwP0dYk +lHFFfp5XPOZ2QWxdVX1dm34KRO9NDdcDFvegp8sKb9zbvqX/Pwz52Ui2FMpHYko3 +Rc70UxRPhbOr1vtJk2cQXPz9vrMTRrg2gOuiOJpjL7rEgGOEJ1wCDJwdrtEACaWM +g381PetKkYPej4KAuRCNfovxtGN7F6rjRPevCmTK6R2/3x+fsXN91/3Jj2yZ6nLJ +vRQf0l+KmSOewx76Ku3dEWsc2oH3gbLr342MTJmACpciMKxJ9DX0cgPaVpgpIhlm +hL1rkkv+NMWy8kE7AuUXRv8RPDfrf9dUD0KbwHne7w/ciB9qYEQjGqq8RH/9KgTI +G5k6Ege9HT3N +=2KjF +-----END PGP PUBLIC KEY BLOCK----- + diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..67a09b0 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for 3rd_party_repos_satellite \ No newline at end of file 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/custom_content.yml b/tasks/custom_content.yml new file mode 100644 index 0000000..963735e --- /dev/null +++ b/tasks/custom_content.yml @@ -0,0 +1,29 @@ +--- + +- name: grep gitlab runner to gitlab activation key + shell: hammer subscription list --organization-id 1 | grep gitlab | awk -F "|" '{print $1}' + register: subscription_gitlab + +- name: add gitlab runner repo to gitlab runner key + command: hammer activation-key add-subscription --subscription-id {{ item }} --organization-id 1 --name gitlab_runner_key + register: cmd + failed_when: cmd.rc not in [128,0] + with_items: + - "{{ subscription_gitlab.stdout_lines }} " + +- name: grep epel to ansible product view key + shell: hammer subscription list --organization-id 1 | grep epel | awk -F "|" '{print $1}' + register: subscription_epel + +- name: add epel to ansible product view key + command: hammer activation-key add-subscription --subscription-id {{ item }} --organization-id 1 --name ansible_tower + register: cmd + failed_when: cmd.rc not in [128,0] + with_items: + - "{{ subscription_epel.stdout_lines }} " + +- name: refresh activation keys + shell: hammer activation-key update --name {{ item }} --organization-id 1 + loop: + - ansible_tower + - gitlab_runner_key diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..ae4924a --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,7 @@ +--- + +- name: move gpg keys to server, create custom repos and sync them + include_tasks: repo_create.yml + +- name: add custom repos to activation keys + include_tasks: custom_content.yml diff --git a/tasks/repo_create.yml b/tasks/repo_create.yml new file mode 100644 index 0000000..e628004 --- /dev/null +++ b/tasks/repo_create.yml @@ -0,0 +1,59 @@ +--- + +- name: Move epel key + copy: + src: files/rpm_gpg_key_gitlab + dest: /opt/rpm_gpg_key_gitlab + owner: root + group: root + +- name: Move epel key + copy: + src: files/rpm_gpg_key_epel_7 + dest: /opt/rpm_gpg_key_epel_7 + owner: root + group: root + +- name: Check to see if localhost is running satellite + shell: command -v hammer >/dev/null 2>&1 + register: is_hammer_exist + +- name: epel key create + command: hammer gpg create --key "{{ rpm_gpg_key_epel_7 }}" --organization "{{ foreman_initial_organization }}" --name "epel_7_key" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: product create EPEL + command: hammer product create --gpg-key "epel_7_key" --name "epel_7_product" --description "EPEL 7 Repository" --organization "{{ foreman_initial_organization }}" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: repo create epel + command: hammer repository create --organization "{{ foreman_initial_organization }}" --content-type yum --download-policy "immediate" --gpg-key "epel_7_key" --name "epel_7_repo" --product "epel_7_product" --url "https://dl.fedoraproject.org/pub/epel/7/x86_64/" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: sync epel repo + command: hammer repository synchronize --organization "{{ foreman_initial_organization }}" --product epel_7_product + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: gitlab key create + command: hammer gpg create --key "{{ rpm_gpg_key_gitlab }}" --organization "{{ org.name }}" --name "gitlab_key" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: product create gitlabrunner + command: hammer product create --gpg-key "gitlab_key" --name "gitlab_product" --description "Gitlabrunner repository" --organization "{{ org.name }}" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: repo create gitlab + command: hammer repository create --organization "{{ org.name }}" --content-type yum --download-policy "immediate" --gpg-key "gitlab_key" --name "gitlab_repo" --product "gitlab_product" --url "https://packages.gitlab.com/runner/gitlab-runner/el/7/x86_64" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: sync epel repo + command: hammer repository synchronize --organization "{{ foreman_initial_organization }}" --product gitlab_product + register: cmd + failed_when: cmd.rc not in [65,0] 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..36b0197 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - 3rd_party_repos_satellite \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..cab14b9 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for 3rd_party_repos_satellite \ No newline at end of file -- GitLab From 172f84becee76754b0f2e68dec689ff77b513449 Mon Sep 17 00:00:00 2001 From: Mike Holmes Date: Mon, 4 Nov 2019 21:50:01 -0600 Subject: [PATCH 2/3] initial --- defaults/main.yml | 4 ++++ files/rpm_gpg_key_epel_7 | 3 +++ files/rpm_gpg_key_gitlab | 3 +++ tasks/main.yml | 8 ++++++++ tasks/repo_create.yml | 21 +++++++++++++++++++++ 5 files changed, 39 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 3f31d8a..3729d6f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,8 @@ --- +<<<<<<< HEAD # defaults file for 3rd_party_repos_satellite foreman_initial_organization: "{{ lookup('env','FOREMAN_INITIAL_ORGANIZATION') }}" foreman_initial_location: "{{ lookup('env','FOREMAN_INITIAL_LOCATION') }}" +======= +# defaults file for 3rd_party_repos_satellite +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/files/rpm_gpg_key_epel_7 b/files/rpm_gpg_key_epel_7 index ea929f9..2916caa 100644 --- a/files/rpm_gpg_key_epel_7 +++ b/files/rpm_gpg_key_epel_7 @@ -27,4 +27,7 @@ vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== =hdPa -----END PGP PUBLIC KEY BLOCK----- +<<<<<<< HEAD +======= +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/files/rpm_gpg_key_gitlab b/files/rpm_gpg_key_gitlab index b1829f6..9ffec6a 100644 --- a/files/rpm_gpg_key_gitlab +++ b/files/rpm_gpg_key_gitlab @@ -51,4 +51,7 @@ hL1rkkv+NMWy8kE7AuUXRv8RPDfrf9dUD0KbwHne7w/ciB9qYEQjGqq8RH/9KgTI G5k6Ege9HT3N =2KjF -----END PGP PUBLIC KEY BLOCK----- +<<<<<<< HEAD +======= +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/tasks/main.yml b/tasks/main.yml index ae4924a..c8b17dd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,15 @@ --- +<<<<<<< HEAD - name: move gpg keys to server, create custom repos and sync them include_tasks: repo_create.yml - name: add custom repos to activation keys include_tasks: custom_content.yml +======= +- name: Build Custom Repos + import_tasks: repo_create.yml + +- name: Add content to activation keys + import_tasks: custom_content.yml +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/tasks/repo_create.yml b/tasks/repo_create.yml index e628004..44ad67b 100644 --- a/tasks/repo_create.yml +++ b/tasks/repo_create.yml @@ -1,5 +1,6 @@ --- +<<<<<<< HEAD - name: Move epel key copy: src: files/rpm_gpg_key_gitlab @@ -14,10 +15,13 @@ owner: root group: root +======= +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 - name: Check to see if localhost is running satellite shell: command -v hammer >/dev/null 2>&1 register: is_hammer_exist +<<<<<<< HEAD - name: epel key create command: hammer gpg create --key "{{ rpm_gpg_key_epel_7 }}" --organization "{{ foreman_initial_organization }}" --name "epel_7_key" register: cmd @@ -38,6 +42,8 @@ register: cmd failed_when: cmd.rc not in [65,0] +======= +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 - name: gitlab key create command: hammer gpg create --key "{{ rpm_gpg_key_gitlab }}" --organization "{{ org.name }}" --name "gitlab_key" register: cmd @@ -53,7 +59,22 @@ register: cmd failed_when: cmd.rc not in [65,0] +<<<<<<< HEAD - name: sync epel repo command: hammer repository synchronize --organization "{{ foreman_initial_organization }}" --product gitlab_product +======= +- name: epel key create + command: hammer gpg create --key "{{ rpm_gpg_key_epel_7 }}" --organization "{{ foreman_initial_organization }}" --name "epel_7_key" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: product create EPEL + command: hammer product create --gpg-key "epel_7_key" --name "epel_7_product" --description "EPEL 7 Repository" --organization "{{ foreman_initial_organization }}" + register: cmd + failed_when: cmd.rc not in [65,0] + +- name: repo create epel + command: hammer repository create --organization "{{ foreman_initial_organization }}" --content-type yum --download-policy "immediate" --gpg-key "epel_7_key" --name "epel_7_repo" --product "epel_7_product" --url "https://dl.fedoraproject.org/pub/epel/7/x86_64/" +>>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 register: cmd failed_when: cmd.rc not in [65,0] -- GitLab From cfa56867b8ca0f7369233704e431f57d22773018 Mon Sep 17 00:00:00 2001 From: Mike Holmes Date: Mon, 4 Nov 2019 21:52:00 -0600 Subject: [PATCH 3/3] remove conflicts --- defaults/main.yml | 4 ---- files/rpm_gpg_key_epel_7 | 4 ---- files/rpm_gpg_key_gitlab | 4 ---- tasks/main.yml | 8 -------- tasks/repo_create.yml | 21 --------------------- 5 files changed, 41 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3729d6f..3f31d8a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,4 @@ --- -<<<<<<< HEAD # defaults file for 3rd_party_repos_satellite foreman_initial_organization: "{{ lookup('env','FOREMAN_INITIAL_ORGANIZATION') }}" foreman_initial_location: "{{ lookup('env','FOREMAN_INITIAL_LOCATION') }}" -======= -# defaults file for 3rd_party_repos_satellite ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/files/rpm_gpg_key_epel_7 b/files/rpm_gpg_key_epel_7 index 2916caa..4f5e482 100644 --- a/files/rpm_gpg_key_epel_7 +++ b/files/rpm_gpg_key_epel_7 @@ -27,7 +27,3 @@ vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== =hdPa -----END PGP PUBLIC KEY BLOCK----- -<<<<<<< HEAD - -======= ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/files/rpm_gpg_key_gitlab b/files/rpm_gpg_key_gitlab index 9ffec6a..10d6194 100644 --- a/files/rpm_gpg_key_gitlab +++ b/files/rpm_gpg_key_gitlab @@ -51,7 +51,3 @@ hL1rkkv+NMWy8kE7AuUXRv8RPDfrf9dUD0KbwHne7w/ciB9qYEQjGqq8RH/9KgTI G5k6Ege9HT3N =2KjF -----END PGP PUBLIC KEY BLOCK----- -<<<<<<< HEAD - -======= ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/tasks/main.yml b/tasks/main.yml index c8b17dd..ae4924a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,15 +1,7 @@ --- -<<<<<<< HEAD - name: move gpg keys to server, create custom repos and sync them include_tasks: repo_create.yml - name: add custom repos to activation keys include_tasks: custom_content.yml -======= -- name: Build Custom Repos - import_tasks: repo_create.yml - -- name: Add content to activation keys - import_tasks: custom_content.yml ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 diff --git a/tasks/repo_create.yml b/tasks/repo_create.yml index 44ad67b..e628004 100644 --- a/tasks/repo_create.yml +++ b/tasks/repo_create.yml @@ -1,6 +1,5 @@ --- -<<<<<<< HEAD - name: Move epel key copy: src: files/rpm_gpg_key_gitlab @@ -15,13 +14,10 @@ owner: root group: root -======= ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 - name: Check to see if localhost is running satellite shell: command -v hammer >/dev/null 2>&1 register: is_hammer_exist -<<<<<<< HEAD - name: epel key create command: hammer gpg create --key "{{ rpm_gpg_key_epel_7 }}" --organization "{{ foreman_initial_organization }}" --name "epel_7_key" register: cmd @@ -42,8 +38,6 @@ register: cmd failed_when: cmd.rc not in [65,0] -======= ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 - name: gitlab key create command: hammer gpg create --key "{{ rpm_gpg_key_gitlab }}" --organization "{{ org.name }}" --name "gitlab_key" register: cmd @@ -59,22 +53,7 @@ register: cmd failed_when: cmd.rc not in [65,0] -<<<<<<< HEAD - name: sync epel repo command: hammer repository synchronize --organization "{{ foreman_initial_organization }}" --product gitlab_product -======= -- name: epel key create - command: hammer gpg create --key "{{ rpm_gpg_key_epel_7 }}" --organization "{{ foreman_initial_organization }}" --name "epel_7_key" - register: cmd - failed_when: cmd.rc not in [65,0] - -- name: product create EPEL - command: hammer product create --gpg-key "epel_7_key" --name "epel_7_product" --description "EPEL 7 Repository" --organization "{{ foreman_initial_organization }}" - register: cmd - failed_when: cmd.rc not in [65,0] - -- name: repo create epel - command: hammer repository create --organization "{{ foreman_initial_organization }}" --content-type yum --download-policy "immediate" --gpg-key "epel_7_key" --name "epel_7_repo" --product "epel_7_product" --url "https://dl.fedoraproject.org/pub/epel/7/x86_64/" ->>>>>>> 6f1f6d3814dd526258e3540cd121f1c7c6814e24 register: cmd failed_when: cmd.rc not in [65,0] -- GitLab