---
- name: Install dependencies
  pacman:
    name: "{{ pacman['packages'] }}"
    update_cache: yes
    state: latest
  become: yes

- name: Enable and start cronie
  systemd:
    name: cronie
    enabled: yes
    state: started
  become: yes

- name: Create crontab entry to clone/pull git repository
  template:
    src: etc_cron.d_ansible-pull.j2
    dest: /etc/cron.d/ansible-pull
    owner: "{{ ansible_user_id }}"
    group: "{{ ansible_user_id }}"
    mode: 0644
  become: yes

- name: Create logrotate entry for ansible-pull.log
  template:
    src: etc_logrotate.d_ansible-pull.j2
    dest: /etc/logrotate.d/ansible-pull
    owner: "{{ ansible_user_id }}"
    group: "{{ ansible_user_id }}"
    mode: 0644
  become: yes

---
- name: Install dependencies
  pacman:
    name: "{{ pacman['packages'] }}"
    update_cache: yes
    state: latest
  become: yes

- name: Enable and start cronie
  systemd:
    name: cronie
    enabled: yes
    state: started
  become: yes

- name: Create crontab entry to clone/pull git repository
  template:
    src: etc_cron.d_ansible-pull.j2
    dest: /etc/cron.d/ansible-pull
    owner: root
    group: root
    mode: 0644
  become: yes

- name: Create logrotate entry for ansible-pull.log
  template:
    src: etc_logrotate.d_ansible-pull.j2
    dest: /etc/logrotate.d/ansible-pull
    owner: root
    group: root
    mode: 0644
  become: yes

Change cron and logrotate target ownership to root
Change cron and logrotate target ownership to root
