Comment 3 for bug 1915761

Revision history for this message
Alex Schultz (alex-schultz) wrote :

How to find vars:
grep ansible_ * -r | egrep -v "(facts|become|user|host|limit|check_mode|python|ssh|connection|min_|managed|ceph_ansible|verbos|hieradata|job|_home|_log|loop|async|limit|filter|_version|calling_|_inventory|\.py|group_vars|diff_mode)" | grep ansible_

bulk fix vars:
# THT
for DIR in common deployment; do
# tripleo-ansible
#for DIR in tripleo_ansible/roles; do
  find $DIR -type f | xargs sed -i \
    -e "s/ansible_hostname\([\ |\.]\)/ansible_facts['hostname']\1/g" \
    -e "s/ansible_fqdn\([\ |\.]\)/ansible_facts['fqdn']\1/g" \
    -e "s/ansible_nodename\([\ |\.]\)/ansible_facts['nodename']\1/g" \
    -e "s/ansible_distribution\([\ |\.]\)/ansible_facts['distribution']\1/g" \
    -e "s/ansible_distribution_version\([\ |\.]\)/ansible_facts['distribution_version']\1/g" \
    -e "s/ansible_distribution_major_version\([\ |\.]\)/ansible_facts['distribution_major_version']\1/g" \
    -e "s/ansible_os_family\([\ |\.]\)/ansible_facts['os_family']\1/g" \
    -e "s/ansible_devices\([\ |\.]\)/ansible_facts['devices']\1/g"
done