Skip to content

Commit

Permalink
Drop overwrite_etc_hosts setting
Browse files Browse the repository at this point in the history
When using hostnamectl and nss-myhostname this isn't needed.
  • Loading branch information
ekohl authored and evgeni committed Mar 5, 2024
1 parent a6f61dd commit 83d1bf7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 17 deletions.
5 changes: 2 additions & 3 deletions docs/satellite-clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ Cloning a Satellite with external databases can be done using `installer_additio
3. Set up remote databases according to [Satellite documentation](https://access.redhat.com/documentation/en-us/red_hat_satellite/) in the same way that they were set up on your original Satellite. Do not run any installer steps on the target RHEL8 machine that will become the clone.
4. The remote databases for the clone will also need to be reached on the same hostname as ones used for the original Satellite. You can use `/etc/hosts` on the target server to associate the original remote database hostnames with the new clone database IP addresses. Make sure they are reachable from the target server.
5. Install satellite-clone on target server according to [instructions](#instructions), but don't run the playbook yet.
6. Change “overwrite_etc_hosts: true” to false in the `satellite-clone-vars.yml` config file.
7. You will need to make sure the backup hostname can resolve to 127.0.0.1 on the target server. You can update /etc/hosts with this hostname before cloning.
8. Proceed to run the clone playbook as specified in the [instructions](#instructions).
6. You will need to make sure the backup hostname can resolve to 127.0.0.1 on the target server. You can update /etc/hosts with this hostname before cloning.
7. Proceed to run the clone playbook as specified in the [instructions](#instructions).
1 change: 0 additions & 1 deletion roles/satellite-clone/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ org: changeme
enable_repos: True
restorecon: False
skip_satellite_rpm_check: False
overwrite_etc_hosts: True
check_networking_interfaces: True
selinux_packages:
- foreman-selinux
Expand Down
6 changes: 0 additions & 6 deletions roles/satellite-clone/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@
hostname:
name: "{{ hostname }}"

- name: create /etc/hosts
template:
src: hosts.j2
dest: /etc/hosts
when: overwrite_etc_hosts

# Install Satellite packages

- name: Enable {{ satellite_module }}:el8 module
Expand Down
2 changes: 0 additions & 2 deletions roles/satellite-clone/templates/hosts.j2

This file was deleted.

5 changes: 0 additions & 5 deletions satellite-clone-vars.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
# Disable checking that satellite is already installed. (defaults to false)
#skip_satellite_rpm_check: false

# Overwrite /etc/hosts file (defaults to true). The playbook will overwrite /etc/hosts file with the hostname from the backup files provided. If you
# have a custom /etc/hosts file and do not want it overwritten, you can disable this step and setup the file yourself. If you
# do disable this option, make sure the source server's (original Satellite's) hostname can resolve to 127.0.0.1.
#overwrite_etc_hosts: true

# Disable checking interfaces setup for DHCP and DNS match the interfaces on the target server. (defaults to true)
#check_networking_interfaces: true

Expand Down

0 comments on commit 83d1bf7

Please sign in to comment.