diff options
Diffstat (limited to 'ansible/roles')
4 files changed, 73 insertions, 0 deletions
diff --git a/ansible/roles/lan1-dhcp-client/files/lan1-dhcp b/ansible/roles/lan1-dhcp-client/files/lan1-dhcp new file mode 100644 index 0000000..81922ce --- /dev/null +++ b/ansible/roles/lan1-dhcp-client/files/lan1-dhcp @@ -0,0 +1,2 @@ +auto eth0 +iface eth0 inet dhcp diff --git a/ansible/roles/lan1-dhcp-client/tasks/main.yml b/ansible/roles/lan1-dhcp-client/tasks/main.yml new file mode 100644 index 0000000..fb5d06e --- /dev/null +++ b/ansible/roles/lan1-dhcp-client/tasks/main.yml @@ -0,0 +1,7 @@ +- name: "configure LAN1 (eth0) to be a DHCP client" + copy: + src: lan1-dhcp + dest: /etc/network/interfaces.d/lan1-dhcp + +- name: bring up LAN1 (eth0) + shell: ifup eth0 diff --git a/ansible/roles/sane-debian-system/tasks/main.yml b/ansible/roles/sane-debian-system/tasks/main.yml new file mode 100644 index 0000000..187539c --- /dev/null +++ b/ansible/roles/sane-debian-system/tasks/main.yml @@ -0,0 +1,63 @@ +# Set hostname. + +- name: set hostname + hostname: name={{ hostname }} + +- name: add hostname to /etc/hosts + lineinfile: + dest: /etc/hosts + regexp: '^127\.0\.0\.1' + line: "127.0.0.1 localhost {{ hostname }}" + owner: root + group: root + mode: 0644 + +# Configure the main sources.list using a Jinja2 template, because +# there's a whole bunch of repos and there's some conditional repos +# involved. + +- name: configure main sources.list + template: + src: sources.list.j2 + dest: /etc/apt/sources.list + +# Update lists, upgrade packages. + +- name: update apt package lists + apt: + update_cache: yes + cache_valid_time: 0 + +- name: upgrade packages + apt: + upgrade: dist + +- name: free up disk space by removing apt package cache + shell: | + apt"-get" clean + +# Install/configure packages that are always needed. + +- name: install acpi-support-base + apt: name=acpi-support-base + +- name: install ntp + apt: name=ntp + +- name: install locales + apt: name=locales + +- name: create en_GB.UTF-8 locale + locale_gen: state=present name=en_GB.UTF-8 + +- name: create fi_FI.UTF-8 locale + locale_gen: state=present name=fi_FI.UTF-8 + +# Get rid of bash-completion. It tends to irritate me more than it is +# ever helpful. + +- name: REMOVE bash-completion + apt: + name: bash-completion + state: absent + purge: yes diff --git a/ansible/roles/sane-debian-system/templates/sources.list.j2 b/ansible/roles/sane-debian-system/templates/sources.list.j2 new file mode 100644 index 0000000..841bfd3 --- /dev/null +++ b/ansible/roles/sane-debian-system/templates/sources.list.j2 @@ -0,0 +1 @@ +deb {{ debian_mirror }} {{ distro }} main non-free contrib |