Ondřej Ezr
2020-03-16 69be6526d2e42778bdc61ffbfdd893bde244cbbc
Improve satellite installation (#1340)

1 files added
6 files modified
147 ■■■■■ changed files
ansible/roles/satellite-installation/README.adoc 28 ●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/defaults/main.yml 4 ●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/tasks/main.yml 14 ●●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/tasks/remove_epel_repos.yml 23 ●●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/tasks/version_6.4.yml 21 ●●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/tasks/version_6.6.yml 31 ●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/tasks/version_6.7.yml 26 ●●●● patch | view | raw | blame | history
ansible/roles/satellite-installation/README.adoc
@@ -3,22 +3,21 @@
:author: GPTE Team
:tag1: install_satellite
:tag2: install_firewalld
:tag3: public_hostname
:tag4: update_satellite_host
:tag5: setup_satellite
:tag3: update_satellite_host
:tag4: setup_satellite
:main_file: tasks/main.yml
:version_file: tasks/version_6.4.yml
:version_file: tasks/version_6.7.yml
Role: {role}
============
This role installs and configure satellite and setup firewalld.
This role installs and configure satellite and setup firewalld.
Requirements
------------
. Basic repository should be configure to install packages.
. Basic repository should be configure to install packages.
Role Variables
--------------
@@ -35,7 +34,7 @@
[source=text]
----
satellite_version: 6.4
satellite_version: 6.7
satellite_admin: admin
satellite_admin_password: password
firewall_services:
@@ -53,9 +52,8 @@
|===
|{tag1} |Consistent tag for all satellite install tasks
|{tag2} |For firewall tasks
|{tag3} |For hostname setup tasks
|{tag4} |For host update tasks
|{tag5} |For satellite setup tasks
|{tag3} |For host update tasks
|{tag4} |For satellite setup tasks
|===
* Example tags
@@ -79,7 +77,9 @@
[source=text]
----
[user@desktop ~]$ cat sample_vars.yml
satellite_version: 6.4
satellite_version: 6.7
satellite_admin: 'admin'
satellite_admin_password: 'changeme'
firewall_services:
  - ssh
  - RH-Satellite-6
@@ -102,7 +102,7 @@
Dependencies
------------
Role has dependency of role satellite-public-hostname.
Role has dependency of role satellite-public-hostname.
Tips to update Role
@@ -110,10 +110,10 @@
To extend role works for other version, create new file named  version_{{satellite_version}}.yml and import newly created file in main.yml
for reference look at link:{main_file}[main.yml] and link:{version_file}[version_6.4.yml]
for reference look at link:{main_file}[main.yml] and link:{version_file}[version_6.7.yml]
Author Information
------------------
{author}
{author}
ansible/roles/satellite-installation/defaults/main.yml
@@ -34,5 +34,5 @@
  - 8000/tcp
# - 8140/tcp
  - 8443/tcp
# - 9090/tcp
# - 16514/tcp
  - 9090/tcp
# - 16514/tcp
ansible/roles/satellite-installation/tasks/main.yml
@@ -1,9 +1,21 @@
---
- import_tasks: remove_epel_repos.yml
  tags:
    - install_satellite
- import_tasks: firewalld.yml
  tags:
    - install_satellite
    - install_firewalld
- name: Update system
  package:
    name: '*'
    state: latest
  tags:
    - install_satellite
    - update_satellite_host
## Import for version satellite 6.4 ##
- import_tasks: version_6.4.yml
  when: satellite_version == 6.4
ansible/roles/satellite-installation/tasks/remove_epel_repos.yml
New file
@@ -0,0 +1,23 @@
# vim: set ft=ansible:
---
- name: Remove epel-release package
  package:
    name: epel-release
    use: yum
    state: absent
- name: Remove epel repository files
  file:
    path: /etc/yum.repos.d/epel.repo
    state: absent
  tags:
    - configure_repos
    - remove_existing_repos
- name: Remove epel-testing repository files
  file:
    path: /etc/yum.repos.d/epel-testing.repo
    state: absent
  tags:
    - configure_repos
    - remove_existing_repos
ansible/roles/satellite-installation/tasks/version_6.4.yml
@@ -1,28 +1,23 @@
---
- name: Update system
  package:
    name: '*'
    state: latest
  tags:
    - install_satellite
    - update_satellite_host
- name: Install Satellite Package
  package:
  package:
    name: satellite-6.4*.el7*
    state: present
  tags:
    - install_satellite
- name: configure satellite
- name: configure satellite
  command: >-
    satellite-installer --scenario satellite
    satellite-installer --scenario satellite
    --foreman-admin-username {{ satellite_admin }}
    --foreman-admin-password {{ satellite_admin_password }}
    --certs-cname {{inventory_hostname}}
    --foreman-proxy-dhcp true
    --foreman-proxy-dhcp-provider libvirt
    --foreman-proxy-dns true
    --foreman-proxy-dns-provider libvirt
  async: 3600
  poll: 36
  poll: 72
  tags:
    - install_satellite
    - setup_satellite
ansible/roles/satellite-installation/tasks/version_6.6.yml
@@ -1,28 +1,25 @@
---
- name: Update system
  package:
    name: '*'
    state: latest
- name: Install Satellite Package
  package:
    name: satellite
    state: present
  async: 1800
  poll: 36
  tags:
    - install_satellite
    - update_satellite_host
- name: Install Satellite Package
  package:
    name: satellite-6.6*.el7*
    state: present
  tags:
    - install_satellit
- name: configure satellite
- name: configure satellite
  command: >-
    satellite-installer --scenario satellite
    satellite-installer --scenario satellite
    --foreman-initial-admin-username {{ satellite_admin }}
    --foreman-initial-admin-password {{ satellite_admin_password }}
    --certs-cname {{inventory_hostname}}
    --certs-cname {{ inventory_hostname }}
    --foreman-proxy-dhcp true
    --foreman-proxy-dhcp-provider libvirt
    --foreman-proxy-dns true
    --foreman-proxy-dns-provider libvirt
  async: 3600
  poll: 36
  poll: 72
  tags:
    - install_satellite
    - setup_satellite
ansible/roles/satellite-installation/tasks/version_6.7.yml
@@ -1,28 +1,26 @@
---
- name: Update system
  package:
    name: '*'
    state: latest
  tags:
    - install_satellite
    - update_satellite_host
- name: Install Satellite Package
  package:
  package:
    name: satellite
    state: present
  async: 1800
  poll: 36
  tags:
    - install_satellite
- name: configure satellite
- name: configure satellite
  command: >-
    satellite-installer --scenario satellite
    satellite-installer --scenario satellite
    --foreman-initial-admin-username {{ satellite_admin }}
    --foreman-initial-admin-password {{ satellite_admin_password }}
    --certs-cname {{inventory_hostname}}
    --certs-cname {{ inventory_hostname }}
    --enable-foreman-plugin-remote-execution-cockpit
    --foreman-proxy-dhcp true
    --foreman-proxy-dhcp-provider libvirt
    --foreman-proxy-dns true
    --foreman-proxy-dns-provider libvirt
  async: 3600
  poll: 36
  poll: 72
  tags:
    - install_satellite
    - setup_satellite