Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChanged IPs to Hostnames where possible, and removed host.present tes… #369
Conversation
|
Thanks for the PR! We actually have moved off Linode, and are using DNS instead of the hosts file for name resolution, so the |
|
Fixed. Thank you. |
|
LGTM, please squash these commits together. |
|
Actually, we should use a Salt I checked on the builders and this should be suitable for the contents of that file:
Here are some docs on |
9c4679c
to
a6ede2b
|
There. All tested, /etc/hosts is managed, all the extraneous stuff is gone, and it's all squashed into one commit. Is there anything else I should do? |
| /etc/hosts: | ||
| file.managed: | ||
| - contents: "127.0.0.1 localhost\n::1 localhost\n255.255.255.255 broadcasthost" |
This comment has been minimized.
This comment has been minimized.
aneeshusa
May 11, 2016
Member
We should put these into a file and refer to them using source instead of contents. Please make a common/files directory, and put these into a file called hosts in that directory.
|
I have to go to bed, and a busy day tomorrow, so I will get back to you Thursday or Friday. Thank you for your help. |
| /etc/hosts: | ||
| file.managed: | ||
| - contents: "127.0.0.1 localhost\n::1 localhost\n255.255.255.255 broadcasthost" | ||
| - |
This comment has been minimized.
This comment has been minimized.
aneeshusa
May 11, 2016
Member
Please also add user: root and mode: 644.
The group is variable and depends on the OS, so we need to use Jinja templating to set it up. It should be root on Ubuntu and wheel on OS X.
|
@setupminimal Any progress? Any questions? |
|
I have been banging my head on this for a while, interspersed with studying for finals, and I can't find the problem. I tried to put the /etc/hosts contents in a file, as you said, but then I haven't been able to refer to that file properly. Would you look at what I'm doing and tell me where I went wrong please? |
|
The way to refer to the file is adding this key/value pair to the For reference, here is the docs link again: https://docs.saltstack.com/en/2015.5/ref/states/all/salt.states.file.html#salt.states.file.managed. I'm not sure where you got the
Hopefully that helps; let me know if that's unclear. |
| {% for ssh_user in common.ssh_users %} | ||
| sshkey-{{ ssh_user }}: | ||
| ssh_auth.present: | ||
| - user: root | ||
| - source: salt://{{ tpldir }}/ssh/{{ ssh_user }}.pub | ||
| {% endfor %} | ||
| hosts-file: |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Jun 8, 2016
Member
This can be /etc/hosts instead, and then the name parameter is unnecessary down below.
| {% if grains['os'] == 'MacOS' %} | ||
| - group: wheel | ||
| {% elif grains['os'] == 'Ubuntu' %} | ||
| - group: root" |
This comment has been minimized.
This comment has been minimized.
|
@setupminimal Sorry to leave this hanging, I didn't see you had updated this! This LGTM and should be good to go after a squash. |
| {% elif grains['os'] == 'Ubuntu' %} | ||
| - group: root | ||
| {% endif %} | ||
| - source: salt://{{ tlpdir }}/files/hosts |
This comment has been minimized.
This comment has been minimized.
|
Also please rebase against master when you squash. |
|
|
|
Closing due to lack of response; these commits have been folded into #577. |
setupminimal commentedMay 10, 2016
•
edited by aneeshusa
…ts from common/init.sls
This theoretically solves Issue #288. It certainly prevents /etc/hosts from being messed with, and the recommended testing in Vagrant returns all green. I'm still not entirely sure that I didn't miss something, just because I'm unfamiliar with saltfs's code, so I would appreciate some feedback.
This change is