RedHatSatellite / satellite-clone

Utility to assist cloning an existing Satellite 6 server to a new host
GNU General Public License v3.0
37 stars 31 forks source link

Check for DNS/DHCP interface on target machine #369

Closed chris1984 closed 4 years ago

chris1984 commented 4 years ago

Tested from 6.2 up to 6.6 with 2 interfaces and it working and 1 interface where it fails. All tests pass correctly. Output from 6.6:

With 1 nic:

msg: The network interface ens224 setup for DNS and ens224 setup for DHCP do not match the network interfaces on the current machine

PLAY RECAP ***********************************************************************************************************************************************************************************
localhost                  : ok=8    changed=4    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0   

Monday 24 February 2020  18:05:03 -0500 (0:00:00.063)       0:00:23.163 ******* 
=============================================================================== 
satellite-clone : Grab DHCP interface from Satellite answer file ---------------------------------------------------------------------------------------------------------------------- 6.10s
satellite-clone : Check if DNS is enabled --------------------------------------------------------------------------------------------------------------------------------------------- 5.93s
satellite-clone : Check if DHCP is enabled -------------------------------------------------------------------------------------------------------------------------------------------- 5.35s
satellite-clone : Grab DNS interface from Satellite answer file ----------------------------------------------------------------------------------------------------------------------- 4.91s
satellite-clone : Grab network interfaces from system --------------------------------------------------------------------------------------------------------------------------------- 0.13s
satellite-clone : include_tasks ------------------------------------------------------------------------------------------------------------------------------------------------------- 0.13s
satellite-clone : include_tasks ------------------------------------------------------------------------------------------------------------------------------------------------------- 0.13s
satellite-clone : set fact - satellite_installed -------------------------------------------------------------------------------------------------------------------------------------- 0.07s
satellite-clone : Fail if the destination host is not rhel7 (for migration only) ------------------------------------------------------------------------------------------------------ 0.07s
satellite-clone : Fail if satellite is already installed ------------------------------------------------------------------------------------------------------------------------------ 0.07s
satellite-clone : Check if satellite is already installed ----------------------------------------------------------------------------------------------------------------------------- 0.06s
satellite-clone : Fail if interfaces on machine do not match answer file interfaces --------------------------------------------------------------------------------------------------- 0.06s

With 2 nics:

PLAY RECAP ***********************************************************************************************************************************************************************************
localhost                  : ok=73   changed=29   unreachable=0    failed=0    skipped=31   rescued=0    ignored=0   

Monday 24 February 2020  19:50:09 -0500 (0:00:00.042)       0:48:32.943 ******* 
=============================================================================== 
satellite-clone : Run Satellite installer ------------------------------------------------------------------------------------------------------------------------------------------ 1306.75s
satellite-clone : restore using foreman-maintain ------------------------------------------------------------------------------------------------------------------------------------ 690.06s
satellite-clone : Run installer upgrade to match latest z-version ------------------------------------------------------------------------------------------------------------------- 352.21s
satellite-clone : Wait for foreman-tasks service to start --------------------------------------------------------------------------------------------------------------------------- 300.39s
satellite-clone : Cleanup paused tasks ----------------------------------------------------------------------------------------------------------------------------------------------- 37.62s
satellite-clone : Reset admin password ----------------------------------------------------------------------------------------------------------------------------------------------- 36.26s
satellite-clone : Disable all repos -------------------------------------------------------------------------------------------------------------------------------------------------- 30.93s
satellite-clone : Install Satellite packages ----------------------------------------------------------------------------------------------------------------------------------------- 30.68s
satellite-clone : Install postgresql-server ------------------------------------------------------------------------------------------------------------------------------------------ 21.59s
satellite-clone : Enable required repos for Satellite installation ------------------------------------------------------------------------------------------------------------------- 15.25s
satellite-clone : untar config files (for cloning only) ------------------------------------------------------------------------------------------------------------------------------- 7.46s
satellite-clone : Check if DNS is enabled --------------------------------------------------------------------------------------------------------------------------------------------- 6.00s
satellite-clone : Grab DNS interface from Satellite answer file ----------------------------------------------------------------------------------------------------------------------- 5.96s
satellite-clone : Check if DHCP is enabled -------------------------------------------------------------------------------------------------------------------------------------------- 5.90s
satellite-clone : Migrate candlepin db ------------------------------------------------------------------------------------------------------------------------------------------------ 5.86s
satellite-clone : Grab DHCP interface from Satellite answer file ---------------------------------------------------------------------------------------------------------------------- 5.84s
satellite-clone : Identify the hostname from the backup config tar file --------------------------------------------------------------------------------------------------------------- 5.78s
satellite-clone : check for satellite answers file ------------------------------------------------------------------------------------------------------------------------------------ 5.43s
satellite-clone : Restart katello-service --------------------------------------------------------------------------------------------------------------------------------------------- 4.64s
satellite-clone : Clean yum info ------------------------------------------------------------------------------------------------------------------------------------------------------ 4.39s

Going to kick off Dolly tests on the pr

chris1984 commented 4 years ago

@johnpmitsch fixed :)

chris1984 commented 4 years ago

Manual testing works correctly, waiting on dolly to pass with unrelated test failure.

Test results:

TASK [satellite-clone : Fail if interfaces on machine do not match answer file interfaces] *******************************************************************************************************************************************************************
Friday 28 February 2020  10:51:14 -0500 (0:00:00.078)       0:00:55.124 ******* 
fatal: [localhost]: FAILED! => {"changed": false, "msg": "The network interface ens224 setup for DNS and ens224 setup for DHCP do not match the network interfaces on the current machine"}

msg: The network interface ens224 setup for DNS and ens224 setup for DHCP do not match the network interfaces on the current machine

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=9    changed=0    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0   

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=73   changed=25   unreachable=0    failed=0   

Friday 28 February 2020  12:49:48 -0500 (0:00:00.071)       0:59:02.401 ******* 
=============================================================================== 
satellite-clone : restore using foreman-maintain --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1315.82s
satellite-clone : Run Satellite installer ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1231.63s
satellite-clone : Run installer upgrade to match latest z-version ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 376.78s
satellite-clone : Wait for foreman-tasks service to start ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 300.41s
satellite-clone : Install Satellite packages --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 42.56s
satellite-clone : Cleanup paused tasks --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 38.22s
satellite-clone : Reset admin password --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 36.82s
satellite-clone : Install postgresql-server ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 35.79s
satellite-clone : Disable all repos ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 30.71s
satellite-clone : Enable required repos for Satellite installation ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14.73s
satellite-clone : Check if DNS is enabled ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 12.26s
satellite-clone : Grab DHCP interface from Satellite answer file ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 12.13s
satellite-clone : Check if DHCP is enabled ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11.64s
satellite-clone : Identify the hostname from the backup config tar file ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 11.42s
satellite-clone : Grab DNS interface from Satellite answer file -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11.37s
satellite-clone : Migrate candlepin db ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.53s
satellite-clone : untar config files (for cloning only) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.51s
satellite-clone : Clean yum info ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.08s
satellite-clone : Restart katello-service ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.09s
satellite-clone : check for satellite answers file ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.66s