update code

This commit is contained in:
John Poland 2025-08-12 14:56:38 -04:00
parent f9240e2ed7
commit 4146448a9d
3 changed files with 16 additions and 2 deletions

View File

@ -17,7 +17,7 @@ all:
ansible_aoscx_validate_certs: False ansible_aoscx_validate_certs: False
ansible_aoscx_use_proxy: False ansible_aoscx_use_proxy: False
ansible_acx_no_proxy: True ansible_acx_no_proxy: True
ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ansible_ssh_common_args: "-o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
""" """

View File

@ -8,6 +8,6 @@ done
ansible-playbook -e "ansible_user=$USERNAME" -e "ansible_password=$PASSWORD" -i inventory.yml backup_configs.yml ansible-playbook -e "ansible_user=$USERNAME" -e "ansible_password=$PASSWORD" -i inventory.yml backup_configs.yml
#ansible-playbook -e "ansible_user=$DFLT_USERNAME ansible_password=$DFLT_PASSWORD" -i inventory.yml -l @backup_configs.retry backup_configs.yml #ansible-playbook -e "ansible_user=$DFLT_USERNAME ansible_password=$DFLT_PASSWORD" -i inventory.yml -l @backup_configs.retry backup_configs.yml
run_backup_wlcs.sh /work/run_backup_mx.sh
chown -R 1000:1000 /configs/ chown -R 1000:1000 /configs/

14
code/run_backup_mx.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.9 "show configuration | display set " >/tmp/noc-jmx-104-b.set
ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.10 "show configuration | display set" >/tmp/noc-jmx-104-a.set
for fn in noc-jmx-104-a.set noc-jmx-104-b.set ; do
size=$(stat -c %s /tmp/$fn)
if (( $size > 0 ));then
mv /tmp/$fn /configs/mx
else
rm /tmp/$fn
fi
done