Import the FreeBSD ntp role.

This commit is contained in:
Tom Alexander 2022-10-15 19:59:25 -04:00
parent ae9d65d247
commit 2b1a2bf1d6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
12 changed files with 67 additions and 2 deletions

View File

@ -11,3 +11,4 @@
- base
- firewall
- cpu
- ntp

View File

@ -4,7 +4,6 @@ sendmail_enable="NONE"
hostname="computer"
local_unbound_enable="YES"
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
dumpdev="NO"
zfs_enable="YES"

View File

@ -4,7 +4,6 @@ sendmail_enable="NONE"
hostname="odo"
local_unbound_enable="YES"
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"

View File

@ -0,0 +1 @@
ntpdate_enable="YES"

View File

@ -0,0 +1,4 @@
- name: restart ntpdate
service:
name: ntpdate
state: restarted

View File

@ -0,0 +1,14 @@
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@ -0,0 +1,11 @@
- name: Install Configuration
notify: restart ntpdate
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: rc.conf
dest: /etc/rc.conf.d/ntpdate

View File

@ -0,0 +1,6 @@
# - name: Install packages
# pacman:
# name:
# - foo
# state: present
# update_cache: true

View File

@ -0,0 +1 @@
- import_tasks: tasks/common.yaml

View File

@ -0,0 +1,29 @@
- include_role:
name: per_user
# - name: Create directories
# file:
# name: "{{ account_homedir.stdout }}/{{ item }}"
# state: directory
# mode: 0700
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# loop:
# - ".config/foo"
# - name: Copy files
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
# mode: 0600
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# loop:
# - src: foo.conf
# dest: .config/foo/foo.conf
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'