Commit 6746fadb by John Jarvis

adding hostname role, setting hostname during provisioning

parent 9802b658
......@@ -24,3 +24,5 @@
# gh_users hash must be passed
# in as a -e variable
- gh_users
# Sets hostname to edx-server (default)
- hostname
......@@ -40,17 +40,3 @@
- name: edxlocal | install memcached
apt: pkg=memcached state=present
- name: edxlocal | set the hostname to edx-server (single instance only)
template: src=hosts.j2 dest=/etc/hosts
register: etc_hosts
- name: edxlocal | set the hostname to edx-server (single instance only)
template: src=hostname.j2 dest=/etc/hostname
register: etc_hostname
- name: edxlocal | update hostname
shell: >
hostname -F /etc/hostname
when: etc_hosts.changed or etc_hostname.changed
......@@ -22,7 +22,7 @@
# TODO: give limited sudo access to this group
- name: gh_users | grant full sudo access to gh group
copy: >
content="%adm ALL=(ALL) NOPASSWD:ALL"
content="%gh ALL=(ALL) NOPASSWD:ALL"
dest=/etc/sudoers.d/gh owner=root group=root
mode=0440 validate='visudo -cf %s'
......
---
# A very simple role to change a hostname on an ubuntu server
- name: hostname | update /etc/hosts
template: src=hosts.j2 dest=/etc/hosts
register: etc_hosts
- name: hostname | update /etc/hostname
template: src=hostname.j2 dest=/etc/hostname
register: etc_hostname
- name: hostname | run hostname
shell: >
hostname -F /etc/hostname
when: etc_hosts.changed or etc_hostname.changed
127.0.0.1 {{ edxlocal_hostname }} localhost
127.0.0.1 {{ hostname }} localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment