cronie/tasks/main.yml

32 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2019-04-09 14:33:56 +00:00
---
2022-06-20 20:14:11 +00:00
- name: Include OS-specific variables
include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml"
2019-04-14 09:44:33 +00:00
# tasks file for cronie
- name: Install cronie
2022-11-01 19:03:22 +00:00
package: name="{{cronie_package}}" state=present
2019-04-14 09:44:33 +00:00
become: yes
- name: Enable cronie
2022-06-20 20:14:11 +00:00
service: name="{{cronie_service_name}}" enabled=yes state=started
2020-07-14 10:55:46 +00:00
become: yes
2020-09-21 18:31:05 +00:00
- name: ensure root cron file exist
file:
path: /var/spool/cron/root
2020-12-14 16:32:23 +00:00
mode: 0600 # not required. Mode the file or directory should be. For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers. You must either add a leading zero so that Ansible's YAML parser knows it is an octal number (like C(0644) or C(01777)) or quote it (like C('644') or C('1777')) so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results. As of version 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r)).
2020-09-21 18:31:05 +00:00
state: "touch"
become: true
2020-07-14 10:55:46 +00:00
- name: Set MAILFROM
become: true
lineinfile:
dest: /var/spool/cron/root
regexp: "MAILFROM="
2020-09-21 18:31:05 +00:00
line: "MAILFROM= {{inventory_hostname}}@{{domain.name}}"