Just to give more information of what I am trying.

host (file name)

[server-a]
server-a

[server-b]
server-b


[appserver:children]
server-a
server-b


_________________

 

host_details (file name)

 

[server-a:vars]
env_name=server-a
ansible_ssh_user=root
ansible_ssh_host=10.0.0.1
ansible_ssh_private_key_file=~/.ssh/xyz-key.pem

[server-b:vars]
env_name=server-b
ansible_ssh_user=root
ansible_ssh_host=10.0.0.2
ansible_ssh_private_key_file=~/.ssh/xyz-key.pem



   - I am encrypting host_details file using ansible vault.
   - When I execute the playbook, 
      - Without encryption: Execution is successful
      - With encryption: I get the below error,
   
TASK [setup] 
*******************************************************************
Thursday 10 August 2017  11:21:01 +0100 (0:00:00.053)       0:00:00.053 
*******
fatal: [server-a]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
connect to the host via ssh: ssh: Could not resolve hostname server-a: Name 
or service not known\r\n", "unreachable": true}
fatal: [server-b]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
connect to the host via ssh: ssh: Could not resolve hostname server-b: Name 
or service not known\r\n", "unreachable": true}
Add Comment

On Thursday, August 10, 2017 at 2:21:03 PM UTC+5:30, Siva wrote:
>
> Hi,
>
> Good Day!
>
> I have a requirement to encrypt the host file in ansible, say for example, 
> I want to encrypt the production environment host file so that the host 
> information is not available with every one.
>
> Can anyone tell me if this is achievable with Ansible Vault? Or any 
> alternate way how I can get to this.
>
> Regards,
> Siva
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0bcc62a6-0ec7-448c-b4e9-574867f77647%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to