diff --git a/tasks/main.yml b/tasks/main.yml index f252ef9..b6ab626 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,11 +1,19 @@ --- +- name: Include OS-specific variables + include_vars: "{{ item }}" + with_first_found: + - files: + - "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_os_family }}.yml" + + # tasks file for cronie - name: Install cronie - pacman: name=cronie state=present + package: name=cronie state=present become: yes - name: Enable cronie - service: name=cronie.service enabled=yes state=started + service: name="{{cronie_service_name}}" enabled=yes state=started become: yes - name: ensure root cron file exist diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml new file mode 100644 index 0000000..8824136 --- /dev/null +++ b/vars/Archlinux.yml @@ -0,0 +1,2 @@ +--- +cronie_service_name: cronie.service diff --git a/vars/RedHat.yml b/vars/RedHat.yml new file mode 100644 index 0000000..bfc16b1 --- /dev/null +++ b/vars/RedHat.yml @@ -0,0 +1,2 @@ +--- +cronie_service_name: crond.service