audit dynamic inventory options in jenkinsfiles

This commit is contained in:
2025-10-12 21:10:27 -07:00
parent 22b4ef4336
commit 4c1e9ca914
26 changed files with 115 additions and 83 deletions

View File

@ -45,14 +45,19 @@ pipeline {
//Run the cosmos-base ansible playbook
// /workspace/ansible/playbooks/cosmos-base.yaml
sh """
echo ${params.host_ip}
hash=\$(echo -n ${params.host_ip} | md5sum | cut -c 1-8)
inventory_file="/var/jenkins_home/ansible/.inv/inventory-\$hash.yml"
cd /var/jenkins_home/ansible
ansible-playbook -i /var/jenkins_home/ansible/.inv/inventory-${params.host_ip}.yml \
/var/jenkins_home/ansible/playbooks/lldp-scan.yaml --ssh-common-args='-o StrictHostKeyChecking=no' \
ansible-playbook -i \$inventory_file /var/jenkins_home/ansible/playbooks/lldp-scan.yaml \
--ssh-common-args='-o StrictHostKeyChecking=no' \
--extra-vars "new_hostname=MC-LLDP fixed_size='--window-size=${params.chrome_resolution}' \
run_test=${params.run_test} rename_host=true refresh_only=${params.refresh_only} \
public_deploy=true no_vpn=true matt_public_key='${env.matt_public_key}' \
cosmos_password='${env.cosmos_password}' cosmos_root_password='${env.cosmos_root_password}' "
run_test=${params.run_test} rename_host=true refresh_only=${params.refresh_only} \
public_deploy=true no_vpn=true matt_public_key='${env.matt_public_key}' \
cosmos_password='${env.cosmos_password}' cosmos_root_password='${env.cosmos_root_password}' "
"""
}