Yeah that worked for a debugging scenario so awesome and thanks for that. Might you have any idea how to use those called variables to edit text files? Namely here is the bigger playbook I am trying within the proxy role. I am trying to have it change the name of the .conf file as well as manipulate text within the prod_proxy_conf.j2. It keeps stating that there is an undefined variable however any thoughts?
proxy role main.yml
- name: " Proxy | Setup Proxy"
template:
src: /etc/ansible/files/proxy_files/prod_proxy_conf.j2
dest: /etc/httpd/conf.d/ "{{ hostvars[item]['client_name'] }}".conf
with_items: "{{ groups['app'] }}"
- name: Proxy | Restart Proxy
command: apachectl graceful
- name: Clone template and customize
delegate_to: 127.0.0.1
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
folder: "NECO-App"
validate_certs: "false"
datacenter: "{{ vcenter_datacenter }}"
cluster: "{{ vcenter_cluster }}"
state: "poweredon"
name: "{{ inventory_hostname }}"
template: "{{ app_vsphere_template }}"
networks:
- name: "{{ app_network }}"
ip: "{{ server_ip }}"
netmask: "{{ servers_netmask }}"
gateway: "{{ app_gateway }}"
domain: "{{ app_domain }}"
dns_servers:
- "{{ dns_lookup }}"
wait_for_ip_address: yes
- name: add to in memory inventory
add_host:
hostname: "{{ item }}"
groups: new
tasks:
roles:
- { role: common }
- { role: create_instance }
- { role: setup_tpms }
- { role: upgrade_jboss }
- hosts: proxy
tasks:
roles:
- { role: proxy }