ansible/system
Sam Thursfield adf1cba745 Fix permissions issue with 'cron' module
I have a task like this in a playbook. The ansible_ssh_user is 'root'
for this host.

    - cron:
        hour: 00
        job: /home/backup/backup.sh
        name: baserock.org data backup
        user: backup

Running it gave me the following error:

    TASK: [backup cron job, runs every day at midnight] ***************************
    failed: [baserock-backup1] => {"failed": true}
    msg: crontab: can't open '/tmp/crontabvVjoZe': Permission denied
    crontab: user backup cannot read /tmp/crontabvVjoZe

The temporary file created by the 'cron' module is created with the
Python tempfile.mkstemp() function. This creates a file that is readable
only by 'root' (mode 600). The Busybox `crontab` program then checks if
the file is readable by the 'backup' user, and fails if it isn't. So we
need to make sure the file is world-readable before running `crontab`.
2015-03-23 15:09:05 +00:00
..
__init__.py package files 2014-09-26 11:05:47 -04:00
authorized_key.py Update authorized_key.py 2015-03-05 11:42:34 +01:00
cron.py Fix permissions issue with 'cron' module 2015-03-23 15:09:05 +00:00
group.py Add basic support for OSX groups. 2015-02-13 10:14:37 +01:00
hostname.py Add Linuxmint support in hostname module 2015-02-06 21:29:25 +01:00
mount.py Setting the actual passno and dump defaults, and warning user of consequences in nulling 2015-03-11 21:36:44 -04:00
ping.py file extensions! 2014-09-26 10:37:56 -04:00
seboolean.py file extensions! 2014-09-26 10:37:56 -04:00
selinux.py Set selinux state to 'permissive' for state=disabled 2014-09-30 00:33:55 +02:00
service.py In service_enable, the default of changed is True so we have to set it 2015-03-03 11:23:35 -08:00
setup.py file extensions! 2014-09-26 10:37:56 -04:00
sysctl.py now handles non string values for sysctl 2015-01-19 19:37:57 -05:00
user.py Added HP-UX subclass 2015-02-27 18:32:36 +01:00