INFO
Yes, run it through the wizard as Step 13. The wizard runs the same command you just tested (site.yml --tags tcpwrappers), limited to this round's servers, and it saves the output to the log. If you already ran the real command by hand, running it again is harmless. The only thing that changes is the date line in the banner.
What you'll see in Step 13
- A warning about
databridgev6comes first. It says the repo still can't be reached and thatsite.ymlwill switch it back on, then asks "Run Step 13 anyway?". Answer y. Your check run showed that the MOTD part doesn't touch repos at all, so that warning doesn't apply this time. - The playbook runs. It should finish with
failed=0for each server. - The wizard shows the banner's Kernel line. Because the master is now rebooted, it should say
4.18.0-553.185.1.el8_10. - The repo check at the end. The wizard tries to switch
databridgev6back on, finds it still unreachable, and leaves it off. That's what you want, since you don't use it. - The step shows as partly done, not fully done. That's only because of the
databridgev6repo. The MOTD part worked. If you want a clean progress list, mark Step 13 as done afterwards and note that the leftover is the unused repo.
Before Step 13
Since the master has been rebooted, run Steps 7 to 12 first if you haven't yet. That way the checks record the new kernel on the master too.
After Step 13
Spot-check one server:
ssh rbb-ref-b-vlim02 "grep Kernel /etc/motd"
Then the B side is ready for the Nessus rescan.
=========================================================
The check run is clean, so the real command is safe to run.
What the output shows
- Only the MOTD (login banner) part ran. Every task that did anything came from
ansible-tcpwrappers. No package installs, no yum or repo changes, no restarts. - Only one file would change:
/etc/motd, and only two lines in it:- The deployment date moves from 15 Nov to today.
- The kernel moves from
553.184.1to553.185.1. That's the point of this step: the banner now shows the patched kernel.
- Nothing else changes.
/etc/issue,/etc/motd.d/attand the SSH banner all came backok, which means "already correct, nothing to do". - No errors. The summary line says
changed=1 failed=0 unreachable=0. - The "Gathering Facts" line under "Install Mediator and ESP" is harmless. Ansible always collects basic server info, and nothing was installed.
- The
databridgev6repo wasn't touched. No repo task ran, so it should stay switched off.
Next steps
- Run it for real on vlim02 only. This is the same command without
--check --diff:ansible-playbook site.yml -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin --tags tcpwrappers --limit rbb-ref-b-vlim02 - Check the banner shows the new kernel:
ssh rbb-ref-b-vlim02 "grep Kernel /etc/motd" - If it looks right, run it on the rest of the B side, leaving out vlim06 (it's unreachable):
ansible-playbook site.yml -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin --tags tcpwrappers --limit 'rbb-ref-b-*:!rbb-ref-b-vlim06' - Confirm the unused repo is still off. You should see
enabled = 0(orenabled=0):ansible 'rbb-ref-b-*:!rbb-ref-b-vlim06' -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin -m shell -a "grep -A5 databridgev6 /etc/yum.repos.d/*.repo | grep enabled"
One thing to watch: if the B master still hasn't been rebooted, its banner will still say 553.184.1, because the banner shows the kernel that's currently running. Reboot it first, then run the command, and its banner will show the new kernel too.
===================================
Yes. Ansible has two ways to test a playbook without changing anything. Run them from /etc/ansible/tricycle_ansible_master.
1. --list-tasks: shows what would run, without contacting any server. It only reads the playbook and lists the tasks the tag selects.
ansible-playbook site.yml -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin \
--tags tcpwrappers --limit 'rbb-ref-b-*:!rbb-ref-b-vlim06' --list-tasks
Adding --list-hosts in place of --list-tasks shows which servers the run would cover.
2. --check --diff: a dry run on the servers. It connects and goes through each task, but reports what would change instead of changing it. --diff shows the exact lines it would edit, such as the databridgev6.repo file. Try it on one server first:
ansible-playbook site.yml -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin \
--tags tcpwrappers --limit rbb-ref-b-vlim02 --check --diff
What to look for:
changed:lines tell you what it would edit. For the MOTD, that's/etc/motd, or the tcpwrappers files.- If a repo file appears with
enabled = 1or a new baseurl, the real run would switchdatabridgev6back on. - A failure on a package-install task means the real run would stop there too.
Limits of a check run:
- Some tasks can't be predicted, such as shell commands or tasks that depend on an earlier task's result. Ansible either skips them or marks them as failed in check mode. That doesn't mean the real run would fail.
- A task written with
check_mode: noruns for real even in check mode. That's rare, and--list-taskswon't show it. If you're unsure, take a snapshot of vlim02 first.
Suggested order: run --list-tasks, then --check --diff on vlim02, then the real run on vlim02 alone (replace --check --diff with nothing). Check /etc/motd on vlim02. If that looks right, run it for rbb-ref-b-*:!rbb-ref-b-vlim06.
============================Next==========================
That's fine. The wizard's Step 13 runs your senior's exact command. Before you run it, though, one check is worth doing.
On Sunday, site.yml --tags tcpwrappers didn't only update the MOTD. It also ran shared setup tasks, which pointed databridgev6 at 1.1.0, switched it on, and then tried to install packages from it. That's why it failed before reaching the MOTD part. If those tasks still run with this tag, the same thing will happen.
1. See exactly what the command will do, without running anything:
cd /etc/ansible/tricycle_ansible_master
ansible-playbook site.yml -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin \
--tags tcpwrappers --limit 'rbb-ref-b-*:!rbb-ref-b-vlim06' --list-tasks
2. Then:
- If the list shows only tcpwrappers and MOTD tasks: run the same command without
--list-tasks, or use wizard Step 13 and answer y to "Run Step 13 anyway?". - If it also shows repo or package tasks (names like "Add … repository", "Ensure that the required system packages are installed"): send me the list. The run would fail the same way as Sunday, and we'd need your senior engineer's view on skipping those tasks.
Two notes:
- Add the
--limitshown above. The runbook command runs on the whole inventory, which includes the unreachable vlim06 servers and some A-side servers. That's what made Step 13 fail the first time. - If
databridgev6gets switched back on by the run, switch it off again so dnf keeps working on the servers:
Wizard 1.5.2 doesn't do this switch-off for you yet. I'll add it in the next version.ansible 'rbb-ref-b-*:!rbb-ref-b-vlim06' -i inventories/ref_rbb/hosts_ref_rbb.yml --ask-vault-pass -u dbv6admin -b \ -m ini_file -a "path=/etc/yum.repos.d/databridgev6.repo section=databridgev6 option=enabled value=0"
================================
Here's the background, then your two options.
Background:
- On Sunday, the MOTD update (
site.yml) rewrote thedatabridgev6repo on every B server to point athttp://10.212.176.62/databridgev6_yum_repo-1.1.0/and switched it on. - The B master only has an older folder,
databridgev6_yum_repo-1.0.16. There's no1.1.0folder, so that address returns "404 Not Found". - A switched-on repo that can't be reached makes every dnf command fail. That's why
yum makecachefailed in Step 2 yesterday. - Wizard 1.5.2 spotted this and offered to switch
databridgev6off for the round. You answered yes. It noted that in/root/.os_patch_wizard/repos_turned_off.txtso Step 13 can switch it back on.
Why Step 13 matters here:
- Step 13 runs
site.yml. Besides the MOTD,site.ymlswitchesdatabridgev6(andbase_orch) back on and then installs packages from them. - If
databridgev6_yum_repo-1.1.0still isn't on the B master,site.ymlswitches the repo on, fails to download from it, and stops before reaching the MOTD part. That's exactly what happened withbase_orchon Sunday, and it leaves the repo switched on but broken on every server. - So before running
site.yml, Step 13 checks whether the address works now. If it doesn't, it warns you and asks "Run Step 13 anyway?", with the default set to no.
Option A: fix it first (recommended). Then Step 13 runs cleanly and switches the repo back on for good.
- On the A master, copy the folder across:
scp -rp /var/www/html/databridgev6_yum_repo-1.1.0 root@10.212.176.62:/var/www/html/ - On the B master, check it landed at the right level, then fix permissions and test:
You should seels /var/www/html/databridgev6_yum_repo-1.1.0/repodata/repomd.xml chmod -R a+rX /var/www/html/databridgev6_yum_repo-1.1.0 restorecon -R /var/www/html/databridgev6_yum_repo-1.1.0 curl -sI http://10.212.176.62/databridgev6_yum_repo-1.1.0/repodata/repomd.xml | head -1HTTP/1.1 200 OK. - Run Step 13. It updates the MOTD and then switches
databridgev6back on.
Option B: leave it for later. Answer no when Step 13 asks. The MOTD isn't updated yet, databridgev6 stays switched off (so dnf keeps working), and the patching itself is complete. Run Step 13 once the 1.1.0 folder is in place.
If the A master doesn't have databridgev6_yum_repo-1.1.0 either, use option B and raise it with your senior engineer. The 1.1.0 version in the inventory may not be right for this environment yet.
Comments
Post a Comment