All HowTo's Ansible & Terraform Automation Linux Redhat, Fedora and CentOS Linux

Ansible Playbook to add script to Cron.monthly (or whatever) in Redhat/CentOS

This playbook will add the script “” to the target machine(s) “/etc/cron.monthly” directory thereby having it run each month by cron. You can simply change the location to have it go into one of the other cron.x locations. I’ve used ansible version “ansible 1.9.4”.

- hosts: all

  sudo: yes


  - name: install selinux bindings
    yum: name=libselinux-python state=present

  - copy: src=/ansible/files/ dest=/etc/cron.monthly/ owner=root group=root mode=0755

For more (getting started) see the article here:

Leave a Reply

Your email address will not be published. Required fields are marked *