We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a default variable to let users set other hosts. Currently, I am using the below code.
- name: Add hostname to /etc/hosts become: true lineinfile: dest: /etc/hosts regexp: "127[.]0[.]0[.]1.*" line: "127.0.0.1 localhost.localdomain localhost {{ ansible_hostname }} # added by ansible" state: present backup: yes - name: Add Ansible inventory mappings to /etc/hosts become: true blockinfile: path: /etc/hosts block: | {% for host in groups['all'] %} {{ hostvars[host].ansible_host }} {{ host }} {% endfor %}
I am thinking of switching over to this role and would be great if this part can be handled in this role itself.
FYI, I understand that you guys use 127.0.1.1 for hostname. I'm fine with that approach too. Just need space for peer hosts.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Add a default variable to let users set other hosts.
Currently, I am using the below code.
I am thinking of switching over to this role and would be great if this part can be handled in this role itself.
FYI, I understand that you guys use 127.0.1.1 for hostname. I'm fine with that approach too. Just need space for peer hosts.
The text was updated successfully, but these errors were encountered: