community.general/lib/ansible
Sam Thursfield cad0adc691 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`.
2016-12-08 11:23:28 -05:00
..
cli Transform vault_pass into text when we read it in from the user or a file. (#18699) 2016-12-01 23:42:43 -08:00
compat Move py34 mock_open compat to compat/test/mock (#17157) 2016-08-19 18:11:24 -04:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors Add error info if tabs are found in the yaml (#18343) 2016-11-08 11:43:08 -05:00
executor unified boolean function 2016-11-29 12:34:30 -05:00
galaxy For container enabled role, display warning only when not ANSIBLE_CONTAINER (#18717) 2016-12-02 10:08:10 -05:00
inventory Properly sort groups by name as well as depth when getting vars 2016-11-18 22:57:52 -06:00
module_utils module_utils: ovirt: Add support to fetch nested object's attributes (#18666) 2016-12-05 15:23:42 -05:00
modules Fix permissions issue with 'cron' module 2016-12-08 11:23:28 -05:00
parsing Remove method that isn't used here. (#18713) 2016-12-02 00:30:41 -08:00
playbook smart quotes, die die die. 2016-12-05 14:15:43 -08:00
plugins add back reverted change to network_cli (#18761) 2016-12-05 21:42:09 -05:00
template always template when called from template (#18490) 2016-11-15 15:16:46 -05:00
utils module_utils: ovirt: Add support to fetch nested object's attributes (#18666) 2016-12-05 15:23:42 -05:00
vars ansible_playbook_python (#18530) 2016-11-23 16:30:46 -05:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py Document the get_config function 2016-12-05 13:03:14 -08:00
release.py Bumping devel version to 2.3.0 2016-10-03 11:46:31 -05:00
test-requirements.txt Making the switch to v2 2015-05-03 21:47:26 -05:00