Merge pull request #1 from Ownercz/Ownercz-review

master
Davous3k 3 years ago committed by GitHub
commit e992308cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      README.md
  2. 3
      chrony.yml
  3. 2
      chrony/handlers/main.yml
  4. 12
      chrony/tasks/main.yml
  5. 2
      chrony/tasks/ubuntu.yml
  6. 6
      chrony/templates/chrony.conf.j2
  7. 3
      chrony/vars/ubuntu.yml

@ -0,0 +1,3 @@
# TODO
- Add readme, as it is always needed. Who knows who will want to use this role?
- - At least: 1) Basic description 2) Important variables 3) Detailed info 4) Playbook example 5) Don't forget to mention other role dependencies

@ -9,4 +9,5 @@
- name: 2. Gather facts
setup: # aka gather_facts
roles:
- chrony
- chrony #naming scheme - in large repo, use sw prefix when desgning a role for software "sw-chrony" or in standalone
# role like this one, use "ansible-chrony" to let the user know that this is in a fact an Ansible role

@ -1,3 +1,5 @@
---
- name: restart chrony
service: name={{ chrony_service_name }} state=restarted
#use newer style of ansible syntax - https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_module.html#examples

@ -1,10 +1,17 @@
---
- name: chrony | Add the OS specific variables
include_vars: "ubuntu.yml"
# designujes roli pro jeden OS (nemas tam specificke vars pro rhel nebo centos)
# zjednodus to, misto include vars ubuntu.yml z vars slozky toto vypust a dej do vars slozky jen "main.yml", kde to vydefinujes
# ansible si to tak natahne by default a nemusis resit
- name: chrony | Installation
include_tasks: "ubuntu.yml"
# fajn ze to je oddelene pres include tasks, ale dalsi veci si neoddelil why?
# ten template a ta service by mohla byt v chrony-setup.yml a misto ubuntu.yml by si to mohl pojmenovat jako install.yml (protoze opet nemas OS-specific
# instalacni postupy, delame jen na ubuntu
- name: chrony | Copy the chrony.conf template file
template:
src: chrony.conf.j2
@ -12,8 +19,13 @@
notify:
- restart chrony
# je dobry kvuli debugu a prehlednosti pojmenovat tasky i cislem od 1. a dale
# hodi se to kdyz poustis ansible, ze hnedka vidis roli + cislo, kde to dela problem
- name: chrony | start and enable chrony service
service:
name: "{{ chrony_service_name }}"
state: "{{ chrony_service_state }}"
enabled: "{{ chrony_service_enabled }}"
# daemon reload neni treba? nebo jo? rekni proc

@ -1,3 +1,5 @@
---
- name: Install the require packages in Ubuntu derivatives
apt: name=chrony state={{ chrony_pkg_state }}
# again old syntax, look up ansible apt module a opis to z toho

@ -37,3 +37,9 @@ makestep 1 3
{% for k, v in chrony_config_extra_options.items() %}
{{ k }} {{ v }}
{% endfor %}
# popis mi plz, co tenhle cyklus udela v sablone pro nasledujici promenne (nad obsahem tech options se nezamyslej, ty jsem si vymyslel):
# chrony_config_extra_options:
# - time_server: ntp.davo.cz
# - follow_drift: yes

@ -3,3 +3,6 @@ chrony_service_name: chrony
chrony_config_location: /etc/chrony/chrony.conf
chrony_config_driftfile: /var/lib/chrony/chrony.drift
chrony_config_keyfile: /etc/chrony/chrony.keys
# proc myslis, ze je dobry/neni dobry to mit pojmenovane vse s prefixem "chrony"?

Loading…
Cancel
Save