Add the rest of the common role

This commit is contained in:
Ryan Cavicchioni 2019-03-16 20:35:27 +00:00
parent ddad3dc65d
commit bd6c3d307a
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
5 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
cron_service_name: cron
resolv_nameserver: []
resolv_options:
- edns0
timezone: UTC

View File

@ -0,0 +1,12 @@
---
- name: "restart resolv"
service:
name: "{{ resolv_service_name }}"
state: restarted
when: resolv_service_name is defined
- name: restart cron
service:
name: "{{ cron_service_name }}"
state: restarted
when: cron_service_name is defined

View File

@ -1,6 +1,24 @@
---
- name: gather OS specific variables
include_vars: "{{ item }} "
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- name: install system utilities
package:
name: "{{ item }}"
state: present
with_items: "{{ sys_utils }}"
- name: configure resolv.conf
template:
src: resolv.conf.j2
dest: /etc/resolv.conf
notify: "restart resolv"
- name: configure system timezone
timezone:
name: "{{ timezone }}"
notify: restart cron

View File

@ -0,0 +1,8 @@
# {{ ansible_managed }}
{% for ns in resolv_nameserver %}
nameserver {{ ns }}
{% endfor %}
{% if resolv_options is defined %}
options {{ resolv_options | join(' ') }}
{% endif %}

View File

@ -0,0 +1,2 @@
---
resolv_service_name: systemd-resolved.service