mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Examples syntax batch4 (#5620)
* Change example syntax on authorized_key module * Change example syntax on cron module * Change example syntax on group module * Change example syntax on hostname module * Change example syntax on seboolean module * Change example syntax on selinux module * Change example syntax on service module * Change example syntax on sysctl module * Change example syntax on systemd module * Change example syntax on user module * Change example syntax on debug module * Change example syntax on fail module * Change example syntax on include module * Change example syntax on include_role module * Change example syntax on include_vars module * Change example syntax on pause module * Change example syntax on wait_for module * Change example syntax on apache2_module module * > Change example syntax on django_manage module * Change example syntax on htpasswd module
This commit is contained in:
parent
ad6999e2eb
commit
b56a9852ee
20 changed files with 261 additions and 87 deletions
|
@ -171,32 +171,59 @@ author:
|
|||
EXAMPLES = '''
|
||||
# Ensure a job that runs at 2 and 5 exists.
|
||||
# Creates an entry like "0 5,2 * * ls -alh > /dev/null"
|
||||
- cron: name="check dirs" minute="0" hour="5,2" job="ls -alh > /dev/null"
|
||||
- cron:
|
||||
name: "check dirs"
|
||||
minute: "0"
|
||||
hour: "5,2"
|
||||
job: "ls -alh > /dev/null"
|
||||
|
||||
# Ensure an old job is no longer present. Removes any job that is prefixed
|
||||
# by "#Ansible: an old job" from the crontab
|
||||
- cron: name="an old job" state=absent
|
||||
- cron:
|
||||
name: "an old job"
|
||||
state: absent
|
||||
|
||||
# Creates an entry like "@reboot /some/job.sh"
|
||||
- cron: name="a job for reboot" special_time=reboot job="/some/job.sh"
|
||||
- cron:
|
||||
name: "a job for reboot"
|
||||
special_time: reboot
|
||||
job: "/some/job.sh"
|
||||
|
||||
# Creates an entry like "PATH=/opt/bin" on top of crontab
|
||||
- cron: name=PATH env=yes value=/opt/bin
|
||||
- cron:
|
||||
name: PATH
|
||||
env: yes
|
||||
value: /opt/bin
|
||||
|
||||
# Creates an entry like "APP_HOME=/srv/app" and insert it after PATH
|
||||
# declaration
|
||||
- cron: name=APP_HOME env=yes value=/srv/app insertafter=PATH
|
||||
- cron:
|
||||
name: APP_HOME
|
||||
env: yes
|
||||
value: /srv/app
|
||||
insertafter: PATH
|
||||
|
||||
# Creates a cron file under /etc/cron.d
|
||||
- cron: name="yum autoupdate" weekday="2" minute=0 hour=12
|
||||
user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate"
|
||||
cron_file=ansible_yum-autoupdate
|
||||
- cron:
|
||||
name: yum autoupdate
|
||||
weekday: 2
|
||||
minute: 0
|
||||
hour: 12
|
||||
user: root
|
||||
job: "YUMINTERACTIVE: 0 /usr/sbin/yum-autoupdate"
|
||||
cron_file: ansible_yum-autoupdate
|
||||
|
||||
# Removes a cron file from under /etc/cron.d
|
||||
- cron: name="yum autoupdate" cron_file=ansible_yum-autoupdate state=absent
|
||||
- cron:
|
||||
name: "yum autoupdate"
|
||||
cron_file: ansible_yum-autoupdate
|
||||
state: absent
|
||||
|
||||
# Removes "APP_HOME" environment variable from crontab
|
||||
- cron: name=APP_HOME env=yes state=absent
|
||||
- cron:
|
||||
name: APP_HOME
|
||||
env: yes
|
||||
state: absent
|
||||
'''
|
||||
|
||||
import os
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue