From 9e4c8093e52931c516e63ea04340ed0ca68205d8 Mon Sep 17 00:00:00 2001 From: Patrick Toal Date: Thu, 6 Dec 2018 16:23:28 -0500 Subject: [PATCH] Working --- .../LICENSE | 21 ----- .../README.md | 85 ----------------- .../defaults/main.yml | 46 ---------- .../handlers/main.yml | 2 - .../meta/.galaxy_install_info | 1 - .../meta/main.yml | 19 ---- .../playbook_example/README.md | 49 ---------- .../playbook_example/config.yml | 9 -- .../playbook_example/hosts.target | 2 - .../playbook_example/requirements.yml | 7 -- .../playbook_example/vars/example-vars.yml | 59 ------------ .../tasks/configure_capsule.yml | 81 ---------------- .../tasks/configure_satellite.yml | 62 ------------- .../tasks/firewall.yml | 53 ----------- .../tasks/install_satellite.yml | 92 ------------------- .../tasks/install_software.yml | 21 ----- .../tasks/main.yml | 11 --- .../tasks/network.yml | 30 ------ .../tasks/registration.yml | 56 ----------- .../tasks/set_facts.yml | 16 ---- .../answerfile.katello-installer.yaml.j2 | 58 ------------ .../templates/hammer_config.yml.j2 | 4 - .../tests/inventory | 1 - .../tests/test.yml | 5 - .../vars/answers.yml | 5 - .../vars/firewall.yml | 15 --- .../vars/install.yml | 18 ---- .../vars/main.yml | 2 - site.yml | 65 ------------- 29 files changed, 895 deletions(-) delete mode 100644 roles/ansible-role-redhat_satellite6_installation/LICENSE delete mode 100644 roles/ansible-role-redhat_satellite6_installation/README.md delete mode 100644 roles/ansible-role-redhat_satellite6_installation/defaults/main.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/handlers/main.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/meta/.galaxy_install_info delete mode 100644 roles/ansible-role-redhat_satellite6_installation/meta/main.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/playbook_example/README.md delete mode 100644 roles/ansible-role-redhat_satellite6_installation/playbook_example/config.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/playbook_example/hosts.target delete mode 100644 roles/ansible-role-redhat_satellite6_installation/playbook_example/requirements.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/playbook_example/vars/example-vars.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/configure_capsule.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/configure_satellite.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/firewall.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/install_satellite.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/install_software.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/main.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/network.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/registration.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tasks/set_facts.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/templates/answerfile.katello-installer.yaml.j2 delete mode 100644 roles/ansible-role-redhat_satellite6_installation/templates/hammer_config.yml.j2 delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tests/inventory delete mode 100644 roles/ansible-role-redhat_satellite6_installation/tests/test.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/vars/answers.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/vars/firewall.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/vars/install.yml delete mode 100644 roles/ansible-role-redhat_satellite6_installation/vars/main.yml diff --git a/roles/ansible-role-redhat_satellite6_installation/LICENSE b/roles/ansible-role-redhat_satellite6_installation/LICENSE deleted file mode 100644 index d0b3815..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Julio Villarreal - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/ansible-role-redhat_satellite6_installation/README.md b/roles/ansible-role-redhat_satellite6_installation/README.md deleted file mode 100644 index ca30abf..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Ansible Satellite 6 Install -=========================== - -Role to install and do basic configuration of Red Hat Satellite 6.X. - -INFORMATION ------------ - -This playbook will take a while to run depending the number of repositories to -sync. - -Requirements ------------- - -You will need ansible and all the required subscriptions for RHEL 7 and -Satellite 6. - -* Disk Partitioning to support Satellite Directories. Refer to installation guide. -* DNS -* NTP -* satellite_deployment_manifest_path variable defined -* Satellite Manifest file is hosted on the Ansible Bastion or available via HTTP or FTP somewhere in the environment. - -Role Variables --------------- - -All variables are in files located in defaults/main.yml - - -Dependencies ------------- - -There is no role dependency for this role. - -Inventory File ----------- - -The example of inventory file for this role is in hosts.target. - -How to run the playbook ------------------------- - -* To run the playbook first you need to create and download the manifest: - -Go to . -- Click "Satellite" -- Click "Register a Satellite" -- Set a Name, select a version and Click "Register" -After this we are going to attach a subscription. -- Click "Attach Subscription" and select the subscription to attach and click -"Attach Selected" -After this we will download the manifest. -- Click "Download manifest" -After this copy the download file inside the /files directory on the role and -name it "satellite_manifest.zip" - -** Then update the variable file in defaults/main.yml in your playbook and -set all mandatory variables for role.: - -You can see example of playbook in playbook_example/config.yml - -* Run the playbook, see README of example playbook - -[playbook readme](./playbook_example/README.rst) - - -License -------- - -MIT - -Author Information ------------------- - -Julio Villarreal Pelegrino more at: http://wwww.juliovillarreal.com - -**Contributors:** - -Petr Balogh - - -Joe Pisciotta - - -Nick Poyant - - -Cameron Wyatt - diff --git a/roles/ansible-role-redhat_satellite6_installation/defaults/main.yml b/roles/ansible-role-redhat_satellite6_installation/defaults/main.yml deleted file mode 100644 index f1509ae..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/defaults/main.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -# defaults file for juliovp01.ansible_satellite6 -# Go over variables bellow and pass them in extra vars, playbook vars, -# vars_files, inventory file or whatever which overwrite these values! - - -# main: -# version should be double! Not string! -satellite_deployment_version: 6.2 -satellite_deployment_hostname_short: "sat" -satellite_deployment_hostname_full: "define.your.fqdn" -satellite_deployment_ip_address: "127.0.0.1" - -# install: -satellite_deployment_plugin_packages: [] - -# network: -satellite_deployment_set_network: false -satellite_deployment_net_prefix: "24" -satellite_deployment_subnet_name: "sat_subnet1" -satellite_deployment_plugin_ports: [] - -# registration: -satellite_deployment_rhn_user: "your_rhn_user" -satellite_deployment_rhn_password: "your_rhn_pass" - -# answers: -# specify answers key: value without -- prefix. Keys you can get when you -# use satellite-installer with --help | less for easier finding -satellite_deployment_answers: - 'answer': 'value' - -# configure_satellite: -satellite_deployment_manifest_path: "satellite_manifest.zip" -satellite_deployment_manifest_dest_path: "/root/satellite_manifest.zip" -satellite_deployment_repositories: - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server (Kickstart)', rel: '7Server', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server (RPMs)', rel: '7Server', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server - RH Common (RPMs)', rel: '7Server', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)', rel: '7Server', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server - Supplementary (RPMs)', rel: '7Server', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Satellite Tools {{ satellite_deployment_version }} (for RHEL 7 Server) (RPMs)', architecture: 'x86_64', state: enable} - - { product_name: 'Red Hat Enterprise Linux Server', name_repo: 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)', architecture: 'x86_64', state: enable} - -# configure_capsules: -satellite_deployment_puppet_env: "production" diff --git a/roles/ansible-role-redhat_satellite6_installation/handlers/main.yml b/roles/ansible-role-redhat_satellite6_installation/handlers/main.yml deleted file mode 100644 index 0e7fc49..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for juliovp01.ansible_satellite6 diff --git a/roles/ansible-role-redhat_satellite6_installation/meta/.galaxy_install_info b/roles/ansible-role-redhat_satellite6_installation/meta/.galaxy_install_info deleted file mode 100644 index 2ba0947..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Tue Nov 20 15:29:14 2018', version: null} diff --git a/roles/ansible-role-redhat_satellite6_installation/meta/main.yml b/roles/ansible-role-redhat_satellite6_installation/meta/main.yml deleted file mode 100644 index d127b4a..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/meta/main.yml +++ /dev/null @@ -1,19 +0,0 @@ -galaxy_info: - author: Julio Villarreal - description: Role to Install Red Hat Satellite 6.X - company: your company (optional) - issue_tracker_url: http://github.com/juliovp01/ansible-satellite6-install - license: MIT - min_ansible_version: 1.6 - platforms: - - name: EL - versions: - - 6 - - 7 - - galaxy_tags: - - satellite - - redhat - - install - - configuration - - satellite6 diff --git a/roles/ansible-role-redhat_satellite6_installation/playbook_example/README.md b/roles/ansible-role-redhat_satellite6_installation/playbook_example/README.md deleted file mode 100644 index 68e2e5e..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/playbook_example/README.md +++ /dev/null @@ -1,49 +0,0 @@ -#Satellite deployment - -This playbook install all dependecies required by satellite, register RHN, -install satellite, and create some basic configuration of satellite. - -##Configuration - -You have to specify a lot of variables for satellite-deployment role. -This playbook assumes that you set all these variables in some variable file -and its path you have to pass as parameter: ``satellite-deployment-vars`` - -##Parameters - -- **satellite-deployment-vars** - This parameter should contains path to variable file which will describe - all related variables for your Satellite server. - For example: ./vars/brq-sat-instance.yml which is relative path from - playbook. - You can see examples in [example-vars.yml](./vars/example-vars.yml) - - -##Requirements - -- requirements are defined in [requirements.yml](./requirements.yml) -- for instll all requirements pleas run: -``ansible-galaxy install -f -r requirements.yml -p roles/`` - -##Execution - -- For execute playbook with whole process of deployment run: - ``ansible-playbook -u root -i host.target -e - '{satellite_deployment_vars: ./vars/path_to_your_vars.yml}' ./config.yml`` - -- You can also only update or run specific ation with scpecify appropriate - tags: -``ansible-playbook -u root -i host.target -e - '{satellite_deployment_vars: ./vars/path_to_your_vars.yml}' - --tags=update_stallite ./config.yml`` - -you can also exclude some tags with ``--skip-tags`` parameter of -ansible-playbook command. - -##Tags - -- **firewall**: set firewall -- **install_satellite**: install satellite -- **update_satellite**: update satellite -- **satellite_deployment_repositories**: deploy repositories -- **rhn**: register rhn diff --git a/roles/ansible-role-redhat_satellite6_installation/playbook_example/config.yml b/roles/ansible-role-redhat_satellite6_installation/playbook_example/config.yml deleted file mode 100644 index b17ec0f..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/playbook_example/config.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- hosts: satellite-server - roles: - - role: 'ntp' - ntp_server: - - '0.pool.ntp.org' - - role: "satellite-deployment" - vars_files: - - "{{ satellite_deployment_vars }}" diff --git a/roles/ansible-role-redhat_satellite6_installation/playbook_example/hosts.target b/roles/ansible-role-redhat_satellite6_installation/playbook_example/hosts.target deleted file mode 100644 index 1693482..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/playbook_example/hosts.target +++ /dev/null @@ -1,2 +0,0 @@ -[satellite] -fqdn.of.your.host satellite_deployment_version=6.2 diff --git a/roles/ansible-role-redhat_satellite6_installation/playbook_example/requirements.yml b/roles/ansible-role-redhat_satellite6_installation/playbook_example/requirements.yml deleted file mode 100644 index 6436ac1..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/playbook_example/requirements.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- src: bennojoy.ntp - name: ntp -- src: https://github.com/petr-balogh/satellite-deployment.git - # version is draft for testing before we push changes to master - version: draft - name: satellite-deployment diff --git a/roles/ansible-role-redhat_satellite6_installation/playbook_example/vars/example-vars.yml b/roles/ansible-role-redhat_satellite6_installation/playbook_example/vars/example-vars.yml deleted file mode 100644 index 701a42f..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/playbook_example/vars/example-vars.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# MY SATELLITE ENVIRONMENT VARIABLES -# main vars -satellite_deployment_hostname_short: "sat" -satellite_deployment_hostname_full: "sat.domain.org" -satellite_deployment_admin_username: "admin" -satellite_deployment_admin_password: "123456" -satellite_deployment_organization: "ORG" -satellite_deployment_location: "BRNO" - -# network -satellite_deployment_ip_address: "10.35.184.33" -satellite_deployment_network_address: "10.35.184.32" -satellite_deployment_net_prefix: "27" -satellite_deployment_gw_address: "10.35.184.62" -satellite_deployment_net_interface: "eth1" -satellite_deployment_dhcp_interface: "{{ satellite_deployment_net_interface }}" -satellite_deployment_dns_interface: "{{ satellite_deployment_net_interface }}" -satellite_deployment_dns_forwarder: "10.35.64.1" -satellite_deployment_dns_zone: "sat.domain.com" -satellite_deployment_dns_reverse_zone: "64.35.10.in-addr.arpa" -satellite_deployment_dhcp_start: "10.35.184.34" -satellite_deployment_dhcp_end: "10.35.184.61" - -#satellite_deployment_plugin_ports - - -# install -satellite_deployment_plugin_packages: - - "foreman-discovery-image" - -# registration vars -satellite_deployment_rhn_user: "rhn_user" -satellite_deployment_rhn_password: "RhnPassW0rD" - -# answers for sattelite installer -satellite_deployment_answers: - "foreman-initial-organization": "{{ satellite_deployment_organization }}" - "foreman-initial-location": "{{ satellite_deployment_location }}" - "foreman-admin-username": "{{ satellite_deployment_admin_username }}" - "foreman-admin-password": "{{ satellite_deployment_admin_password }}" - "foreman-proxy-dns": "true" - "foreman-proxy-dns-interface": "{{ satellite_deployment_dns_interface }}" - "foreman-proxy-dns-zone": "{{ satellite_deployment_dns_zone }}" - "foreman-proxy-dns-forwarders": "{{ satellite_deployment_dns_forwarder }}" - "foreman-proxy-dns-reverse": "{{ satellite_deployment_dns_reverse_zone }}" - "foreman-proxy-dhcp": "true" - "foreman-proxy-dhcp-interface": "{{ satellite_deployment_dhcp_interface }}" - "foreman-proxy-dhcp-range": "{{ satellite_deployment_dhcp_start }} - {{ satellite_deployment_dhcp_end }}" - "foreman-proxy-dhcp-gateway": "{{ satellite_deployment_gw_address }}" - "foreman-proxy-dhcp-nameservers": "{{ satellite_deployment_ip_address }}" - "foreman-proxy-tftp": "true" - "foreman-proxy-tftp-servername": "{{ satellite_deployment_hostname_full }}" - "foreman-proxy-puppetca": "true" - "capsule-puppet": "true" - -# configure_satellite: -satellite_deployment_manifest_path: "http://my.local.server/sat-manifest.zip" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/configure_capsule.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/configure_capsule.yml deleted file mode 100644 index a783a43..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/configure_capsule.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -#Create an Smart Proxy -- name: "Configure capsule | create an smart proxy on the organization" - become: "yes" - shell: "hammer organization add-smart-proxy --name - {{ satellite_deployment_organization }} --smart-proxy-id 1" - -#Add location to the Smart Proxy -- name: "Configure capsule | add location smart proxy" - command: "hammer location add-smart-proxy --name - {{ satellite_deployment_location }} --smart-proxy-id 1" - -#Create domain -- name: "Configure capsule | add domain" - become: "yes" - shell: "hammer domain create --name='{{ satellite_deployment_dns_zone }}'" - ignore_errors: "yes" - -- name: "Configure capsule | add domain to organization" - become: "yes" - shell: "hammer organization add-domain --name - {{ satellite_deployment_organization }} --domain - {{ satellite_deployment_dns_zone }}" - -#Create the DHCP Subnet -- name: "Configure capsule | create subnet" - become: "yes" - shell: "hammer subnet create --dhcp-id 1 --dns-id 1 --dns-primary - {{ satellite_deployment_ip_address }} --domain-ids 1 - --from {{ satellite_deployment_dhcp_start }} - --to {{ satellite_deployment_dhcp_end }} - --gateway {{ satellite_deployment_gw_address }} - --mask {{ satellite_deployment_netmask }} - --name {{ satellite_deployment_subnet_name }} - --network {{ satellite_deployment_network_address }} --tftp-id 1" - -#Add location to Subnet -- name: "Configure capsule | location add subnet" - become: "yes" - shell: "hammer location add-subnet - --name {{ satellite_deployment_location }} - --subnet {{ satellite_deployment_subnet_name }}" - -#Associate the domain to capsule -- name: "Configure capsule | associate domain capsule" - become: "yes" - shell: "hammer domain update --dns-id 1 --id 1" - -#Add Location to Domain -- name: "Configure capsule | add location domain" - become: "yes" - shell: "hammer location add-domain - --name {{ satellite_deployment_location }} - --domain {{ satellite_deployment_dns_zone }}" - -#Adding the Subnet the Organization -- name: "Configure capsule | add subnet the organization" - become: "yes" - shell: "hammer organization add-subnet - --name {{ satellite_deployment_organization }} - --subnet {{ satellite_deployment_subnet_name }}" - -#Add puppet environment -- name: "Configure capsule | add puppet environment" - become: "yes" - shell: "hammer organization add-environment - --name {{ satellite_deployment_organization }} - --environment {{ satellite_deployment_puppet_env }}" - -#Add location to the environment -- name: "Configure capsule | location add environment" - become: "yes" - shell: "hammer location add-environment - --name {{ satellite_deployment_location }} - --environment {{ satellite_deployment_puppet_env }}" - -#Add location to the organization -- name: "Configure capsule | adding location to organization" - shell: "hammer location add-organization - --name {{ satellite_deployment_location }} - --organization {{ satellite_deployment_organization }}" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/configure_satellite.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/configure_satellite.yml deleted file mode 100644 index 11b9cc4..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/configure_satellite.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -#Create Hammer directory on /root -- name: "Configure | create .hammer directory on user" - file: - path: "~/.hammer" - state: "directory" - mode: "0755" - -#Copy the hammer configuration from template to the .hammer directory -- name: "Configure | set configuration for hammer from template" - template: - src: "hammer_config.yml.j2" - dest: "~/.hammer/cli_config.yml" - -#Copy the manifest -- name: "Configure | copy manifest" - become: "yes" - copy: - src: "{{ satellite_deployment_manifest_path }}" - dest: "{{ satellite_deployment_manifest_dest_path }}" - when: "{{ not satellite_deployment_remote_manifest }}" - -- name: "Configure | copy manifest from remote" - become: "yes" - get_url: - url: "{{ satellite_deployment_manifest_path }}" - dest: "{{ satellite_deployment_manifest_dest_path }}" - when: "{{ satellite_deployment_remote_manifest }}" - -#Upload the manifest to the satellite -- name: "Configure | upload the manifest" - become: "yes" - shell: "hammer subscription upload --file - {{ satellite_deployment_manifest_dest_path }} --organization - {{ satellite_deployment_organization }}" - -#Enabling repos on satellite -- name: "Configure | enable repos" - become: "yes" - shell: "hammer repository-set '{{ item.state }}' --organization - '{{ satellite_deployment_organization }}' - --product '{{ item.product_name }}' --name '{{ item.name_repo }}' - {% if item.rel is defined %} --releasever '{{ item.rel }}' {% endif %} - --basearch '{{ item.architecture}}'" - with_items: "{{ satellite_deployment_repositories }}" - ignore_errors: "yes" - tags: - - "satellite_deployment_repositories" - -#Get the repos ids and sync the repos -- name: "Configure | grab repositories uuid" - shell: "hammer repository list --organization - {{ satellite_deployment_organization }} | grep yum | awk '{print $1}'" - register: "repos" - -- name: "Configure | sync repos on satellite" - shell: "hammer repository synchronize --id '{{ item }}' --organization - {{ satellite_deployment_organization }}" - with_items: "{{ repos.stdout_lines }}" - register: "sync_repos_result" - retries: 3 - until: "{{ sync_repos_result | success }}" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/firewall.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/firewall.yml deleted file mode 100644 index d07c9a3..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/firewall.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- name: "Include firewall.yml" - include_vars: "vars/firewall.yml" - tags: - - "firewall" - -#Install firewalld and enable it -- name: "Install firewalld" - become: "yes" - yum: - name: "firewalld" - state: "present" - ignore_errors: "yes" - tags: - - "firewall" - -- name: "Set hostname with hostnamectl" - hostname: - name: "{{ satellite_deployment_hostname_full }}" - tags: - - "firewall" - -- name: "Update /etc/hosts wiht satellite hostname" - lineinfile: - line: "{{ satellite_deployment_ip_address }} - {{ satellite_deployment_hostname_full }} - {{ satellite_deployment_hostname_short }}" - dest: "/etc/hosts" - tags: - - "firewall" - -- name: "Enable Firewalld" - become: "yes" - service: - enabled: "yes" - name: "firewalld" - state: "started" - tags: - - "firewall" - -#Opening firewall ports -- name: "Firewall and hostname | Opening Firewalld ports" - become: "yes" - firewalld: - permanent: "yes" - immediate: "yes" - port: "{{ item }}" - state: "enabled" - with_items: "{{ satellite_deployment_fw_ports + - satellite_deployment_plugin_ports }}" - ignore_errors: "yes" - tags: - - "firewall" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/install_satellite.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/install_satellite.yml deleted file mode 100644 index d2456aa..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/install_satellite.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -- name: "Include answers vars" - include_vars: "vars/answers.yml" - tags: - - "install_satellite" - - "update_satellite" - -# Copy the Katello answer file -- name: "Install and configure | katello answer file copy" - template: - src: "answerfile.katello-installer.yaml.j2" - dest: "/etc/katello-installer/answers.katello-installer.yaml" - tags: - - "install_satellite" - - "update_satellite" - when: "{{ satellite_deployment_version == 6.1 }}" -- name: "Install and configure | katello answer file copy" - template: - src: "answerfile.katello-installer.yaml.j2" - dest: "/etc/foreman-installer/scenarios.d/satellite-answers.yaml" - tags: - - "install_satellite" - - "update_satellite" - when: "{{ satellite_deployment_version == 6.2 }}" -- name: "Install and configure | katello answer file copy" - template: - src: "answerfile.katello-installer.yaml.j2" - dest: "/etc/satellite-installer/scenarios.d/satellite-answers.yaml" - tags: - - "install_satellite" - - "update_satellite" - when: "{{ satellite_deployment_version == 6.3 }}" - -# Check if service exist for foreman -- name: "Install and configure | check if service exist" - stat: - path: "/etc/init.d/foreman" - register: "foreman_service_file" - become: "yes" - tags: - - "install_satellite" - - "update_satellite" - -#Run the install of Satellite if foreman is installed -- name: "Install and configure | satellite installation" - command: "/usr/sbin/katello-installer" - when: "{{ foreman_service_file.stat.exists == True and - satellite_deployment_version == 6.1 }}" - become: "yes" - tags: - - "install_satellite" - - "update_satellite" - -- name: "Update satellite-installer command" - set_fact: - satellite_deployment_installer_cmd: "{{ satellite_deployment_installer_cmd - }} --{{ item.key }}='{{ item.value }}'" - with_dict: "{{ satellite_deployment_answers }}" - when: "{{ satellite_deployment_version == 6.2 }}" - tags: - - "install_satellite" - - "update_satellite" - -#Run the install of Satellite 6.2 -- name: "Satellite 6.2 installation" - command: "{{ satellite_deployment_installer_cmd }}" - become: "yes" - when: "{{ foreman_service_file.stat.exists == True and - satellite_deployment_version == 6.2 }}" - tags: - - "install_satellite" - - "update_satellite" - -- name: "Update satellite-installer command" - set_fact: - satellite_deployment_installer_cmd: "{{ satellite_deployment_installer_cmd - }} --{{ item.key }}='{{ item.value }}'" - with_dict: "{{ satellite_deployment_answers }}" - when: "{{ satellite_deployment_version == 6.3 }}" - tags: - - "install_satellite" - - "update_satellite" - -#Run the install of Satellite 6.3 -- name: "Satellite 6.3 installation" - command: "{{ satellite_deployment_installer_cmd }}" - become: "yes" - when: "{{ foreman_service_file.stat.exists == True and - satellite_deployment_version == 6.3 }}" - tags: - - "install_satellite" - - "update_satellite" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/install_software.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/install_software.yml deleted file mode 100644 index dc36aa3..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/install_software.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: "Include install vars" - include_vars: "vars/install.yml" - tags: - - "install" - - "update_satellite" - -#Install the base software -- name: "Install_software" - become: "yes" - yum: - name: "{{ item }}" - state: "latest" - with_items: "{{ - satellite_deployment_packages[satellite_deployment_version | string] + - satellite_deployment_extra_packages + satellite_deployment_plugin_packages - }}" - tags: - - "install" - - "update_satellite" - - "skip_ansible_lint" # ANSIBLE0010 diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/main.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/main.yml deleted file mode 100644 index 557eb2b..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- include: set_facts.yml -- include: registration.yml -- include: network.yml - when: "{{ satellite_deployment_set_network }}" -- include: firewall.yml -- include: install_software.yml -- include: install_satellite.yml -- include: configure_satellite.yml -- include: configure_capsule.yml - when: "{{ satellite_configure_capsule }}" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/network.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/network.yml deleted file mode 100644 index ed9120f..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/network.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: "Set network interface IP" - shell: "nmcli con mod {{ satellite_deployment_net_interface }} - ipv4.addresses '{{ satellite_deployment_ip_address }}/{{ - satellite_deployment_net_prefix }}'" - tags: - - "set_network" - -- name: "Set network interface GW" - shell: "nmcli con mod {{ satellite_deployment_net_interface }} ipv4.gateway - {{ satellite_deployment_gw_address }}" - tags: - - "set_network" - -- name: "Set network interface method manual" - shell: "nmcli con mod {{ satellite_deployment_net_interface }} ipv4.method - manual" - tags: - - "set_network" - -- name: "Set network interface autoconnect" - shell: "nmcli con mod {{ satellite_deployment_net_interface }} - connection.autoconnect yes" - tags: - - "set_network" - -- name: "Set network interface UP" - shell: "nmcli con up {{ satellite_deployment_net_interface }}" - tags: - - "set_network" diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/registration.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/registration.yml deleted file mode 100644 index 9bde1aa..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/registration.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -#Registering system with RHN. -- name: "RHN | registering system with RHN" - redhat_subscription: - state: "present" - username: "{{ satellite_deployment_rhn_user }}" - password: "{{ satellite_deployment_rhn_password }}" - consumer_name: "{{ satellite_deployment_hostname_full }}" - tags: - - "rhn" - - "skip_ansible_lint" # ANSIBLE0012 - - -- name: "Check if Satellite is subscribed" - shell: "/usr/sbin/subscription-manager list --consumed - --matches='*Satellite*' | awk '/Pool ID/ {print $3}'" - tags: - - "rhn" - - "skip_ansible_lint" # ANSIBLE0012 - register: "satellite_deployment_subscribed" - -#Get the pool id for the pool that contains the Satellite product -- name: "RHN | get RHN pool id" - shell: "/usr/sbin/subscription-manager list --all --available - --matches='*Satellite*' | awk '/Pool ID/ {print $3}' | head -1" - tags: - - "rhn" - register: "satellite_deployment_pool_id_command" - ignore_errors: "yes" - when: "{{ satellite_deployment_pool_id is undefined }}" - -- name: "Set pool_id fact" - set_fact: - "satellite_deployment_pool_id": "{{ - satellite_deployment_pool_id_command.stdout }}" - when: "{{ satellite_deployment_pool_id is undefined }}" - -#Attaching the system to the right Pool -- name: "RHN | subscribing to the right pool" - command: "/usr/sbin/subscription-manager attach - --pool={{ satellite_deployment_pool_id }}" - tags: - - "rhn" - - "skip_ansible_lint" # ANSIBLE0012 - ignore_errors: "yes" - when: "{{ satellite_deployment_subscribed.stdout == '' }}" - - -#Enabling the repos -- name: "RHN | enabling the right repos" - command: "/usr/sbin/subscription-manager repos --disable '*' --enable - rhel-7-server-satellite-{{ satellite_deployment_version }}-rpms - --enable rhel-7-server-rpms --enable rhel-server-rhscl-7-rpms" - tags: - - "rhn" - - "skip_ansible_lint" # ANSIBLE0012 diff --git a/roles/ansible-role-redhat_satellite6_installation/tasks/set_facts.yml b/roles/ansible-role-redhat_satellite6_installation/tasks/set_facts.yml deleted file mode 100644 index cde0069..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tasks/set_facts.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: "Set remote_manifest fact" - set_fact: - "satellite_deployment_remote_manifest": "{{ - 'http://' in satellite_deployment_manifest_path or - 'ftp://' in satellite_deployment_manifest_path }}" - -- name: 'Execute command to get netmask' - shell: "ipcalc --netmask {{ satellite_deployment_ip_address }}/{{ - satellite_deployment_net_prefix }} | cut -d= -f2" - register: "satellite_deployment_netmas_result" - -- name: "Set netmask fact" - set_fact: - "satellite_deployment_netmask": "{{ - satellite_deployment_netmas_result.stdout }}" diff --git a/roles/ansible-role-redhat_satellite6_installation/templates/answerfile.katello-installer.yaml.j2 b/roles/ansible-role-redhat_satellite6_installation/templates/answerfile.katello-installer.yaml.j2 deleted file mode 100644 index f76d5be..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/templates/answerfile.katello-installer.yaml.j2 +++ /dev/null @@ -1,58 +0,0 @@ ---- - certs: - generate: true - deploy: true - group: foreman - katello: true - foreman: - organizations_enabled: true - locations_enabled: true - initial_organization: "{{ satellite_deployment_organization }}" - initial_location: "{{ satellite_deployment_location }}" - custom_repo: true - configure_epel_repo: false - configure_scl_repo: false - ssl: true - server_ssl_cert: /etc/pki/katello/certs/katello-apache.crt - server_ssl_key: /etc/pki/katello/private/katello-apache.key - server_ssl_ca: /etc/pki/katello/certs/katello-default-ca.crt - server_ssl_chain: /etc/pki/katello/certs/katello-default-ca.crt - websockets_encrypt: true - websockets_ssl_key: /etc/pki/katello/private/katello-apache.key - websockets_ssl_cert: /etc/pki/katello/certs/katello-apache.crt - unattended: true - admin_username: "{{ satellite_deployment_admin_username }}" - admin_password: "{{ satellite_deployment_admin_password }}" - capsule: - register_in_foreman: true - pulp_master: true - puppet: true - puppetca: true - templates: false - tftp: true - tftp_servername: "{{ satellite_deployment_ip_address }}" - bmc: false - bmc_default_provider: ipmitool - dhcp: true - dhcp_option_domain: - - "{{ satellite_deployment_dns_zone }}" - dhcp_interface: "{{ satellite_deployment_dhcp_interface }}" - dhcp_gateway: "{{ satellite_deployment_gw_address }}" - dhcp_range: "{{ satellite_deployment_dhcp_start }} {{ satellite_deployment_dhcp_end }}" - dhcp_nameservers: "{{ satellite_deployment_ip_address }}" - dns: true - dns_zone: "{{ satellite_deployment_dns_zone }}" - dns_reverse: "{{ satellite_deployment_dns_reverse_zone }}" - dns_inteface: "{{ satellite_deployment_dns_interface }}" - dns_forwarders: - - "{{ satellite_deployment_dns_forwarder }}" - "foreman::plugin::bootdisk": true - "foreman::plugin::discovery": true - "foreman::plugin::hooks": true - "foreman::plugin::tasks": true - "foreman::plugin::chef": false - "foreman::plugin::default_hostgroup": false - "foreman::plugin::puppetdb": false - "foreman::plugin::setup": false - "foreman::plugin::templates": false - "katello::plugin::gutterball": true diff --git a/roles/ansible-role-redhat_satellite6_installation/templates/hammer_config.yml.j2 b/roles/ansible-role-redhat_satellite6_installation/templates/hammer_config.yml.j2 deleted file mode 100644 index 44f6c64..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/templates/hammer_config.yml.j2 +++ /dev/null @@ -1,4 +0,0 @@ -:foreman: - :username: {{ satellite_deployment_admin_username }} - :password: {{ satellite_deployment_admin_password }} - :request_timeout: -1 diff --git a/roles/ansible-role-redhat_satellite6_installation/tests/inventory b/roles/ansible-role-redhat_satellite6_installation/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/ansible-role-redhat_satellite6_installation/tests/test.yml b/roles/ansible-role-redhat_satellite6_installation/tests/test.yml deleted file mode 100644 index b777a3e..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - juliovp01.ansible_satellite6 \ No newline at end of file diff --git a/roles/ansible-role-redhat_satellite6_installation/vars/answers.yml b/roles/ansible-role-redhat_satellite6_installation/vars/answers.yml deleted file mode 100644 index 1c48697..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/vars/answers.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# check defaults/main.yml which vars you have to pass. - -satellite_deployment_installer_cmd: "/usr/sbin/satellite-installer - --scenario satellite" diff --git a/roles/ansible-role-redhat_satellite6_installation/vars/firewall.yml b/roles/ansible-role-redhat_satellite6_installation/vars/firewall.yml deleted file mode 100644 index 2b0de32..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/vars/firewall.yml +++ /dev/null @@ -1,15 +0,0 @@ -satellite_deployment_fw_ports: - - 22/tcp - - 80/tcp - - 443/tcp - - 5646/tcp - - 5647/tcp - - 5671/tcp - - 5674/tcp - - 8140/tcp - - 9090/tcp - - 53/udp - - 53/tcp - - 67/udp - - 68/udp - - 69/udp diff --git a/roles/ansible-role-redhat_satellite6_installation/vars/install.yml b/roles/ansible-role-redhat_satellite6_installation/vars/install.yml deleted file mode 100644 index 40cd873..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/vars/install.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -satellite_deployment_packages: - "6.1": - - "katello" - "6.2": - - "satellite" - "6.3": - - "satellite" - -satellite_deployment_extra_packages: - - "wget" - - "git" - - "net-tools" - - "bash-completion" - - "screen" - - "vim-*" - -satellite_configure_capsule: true diff --git a/roles/ansible-role-redhat_satellite6_installation/vars/main.yml b/roles/ansible-role-redhat_satellite6_installation/vars/main.yml deleted file mode 100644 index 0d298dd..0000000 --- a/roles/ansible-role-redhat_satellite6_installation/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# check defaults/main.yml which vars you have to pass. diff --git a/site.yml b/site.yml index f46efd9..74e6201 100644 --- a/site.yml +++ b/site.yml @@ -1,69 +1,4 @@ # Toal Lab Site Playbook -- name: Create VMs - hosts: vms - connection: local - gather_facts: no - vars: - # Hack to work around virtualenv python interpreter - ansible_python_interpreter: "{{ ansible_playbook_python }}" - - tasks: - - name: Create Satellite VM in RHV - ovirt_vm: - name: "{{ vm_name }}" - state: running - memory: "{{ vm_memory }}" - -- name: Configure Satellite Servers - hosts: satellite - become: true - roles: - - ansible-role-redhat_satellite6_installation - pre_tasks: - - name: Register to RHSM and connect to Satellite Subscription. - tags: rhsm - redhat_subscription: - state: present - auto_attach: yes - username: "{{ rhn_username }}" - password: "{{ rhn_password }}" - pool: "^Red Hat Satellite Infrastructure Subscription$" - - - name: Required Satellite Repos - tags: rhsm - rhsm_repository: - name: "{{ item }}" - state: present - with_items: - - rhel-7-server-rpms - - rhel-server-rhscl-7-rpms - - rhel-7-server-satellite-6.4-rpms - - rhel-7-server-satellite-maintenance-6-rpms - - rhel-7-server-ansible-2.6-rpms - - rhel-7-server-rh-common-rpms - - - name: Ensure latest versions of packages - yum: - name: "*" - state: latest - - - name: Latest Version of Satellite - yum: - name: satellite - state: latest - - - name: Chronyd Installed - yum: - name: chrony - state: latest - notify: Restart Chrony - - - name: Latest Version of SOS - yum: - name: sos - state: latest - - - name: Common Lab Machine Setup