No description
Find a file
Dag Wieers cabbb9fce7 Add /proc/cmdline information to the default facts
The use-case here is that based on information in the /proc/cmdline certain actions can be taken.

A practical example in our case is that we have a play at the end of the provisioning phase that reboots the system. Since we don't want to accidentally reboot a system (or restart the network) on a production machine, having a way to separate an Anaconda post-install (sshd in chroot) with a normal system is a good way to make that distinction.

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "not '${ansible_cmdline.BOOT_IMAGE}'.startswith('$')"

A practical problem here is the fact that we cannot simply check whether it is set or empty:

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "'${ansible_cmdline.BOOT_IMAGE}'"

If ansible_cmdline was a string, a simple only_if: "'${ansible_cmdline}'.find(' BOOT_IMAGE=')" was an option, but still not very "beautiful" :-/

This implementation uses shlex.split() and uses split(sep, maxsplit=1).
2012-09-06 09:35:33 +02:00
apt
apt_repository Merge branch 'binpath' of https://github.com/sfromm/ansible into devel 2012-08-30 19:24:09 -04:00
assemble backuplocal => backup_local for API standardization reasons 2012-09-04 19:49:49 -04:00
async_status
async_wrapper
authorized_key
command Allow ~ expansion in chdir argument of command module 2012-09-04 14:22:53 +10:00
copy backuplocal => backup_local for API standardization reasons 2012-09-04 19:49:49 -04:00
easy_install Add option required=(True|False) to get_bin_path and update modules 2012-08-30 11:01:37 -07:00
facter
fetch
file
get_url
git Remove obsolete comment 2012-08-28 07:29:32 -04:00
group Add option required=(True|False) to get_bin_path and update modules 2012-08-30 11:01:37 -07:00
lineinfile backuplocal => backup_local for API standardization reasons 2012-09-04 19:49:49 -04:00
mount
mysql_db
mysql_user
nagios Change from a module config file to brute force locating the nagios configs so we can find the command file. 2012-08-28 02:16:07 -04:00
ohai
ping
pip Add option required=(True|False) to get_bin_path and update modules 2012-08-30 11:01:37 -07:00
postgresql_db
postgresql_user
raw
seboolean chmod +x 2012-08-30 19:43:14 -04:00
selinux chmod +x 2012-08-30 19:43:14 -04:00
service Migrate remaining modules to use get_bin_path in module_common.py 2012-08-29 20:26:22 -07:00
setup Add /proc/cmdline information to the default facts 2012-09-06 09:35:33 +02:00
shell
slurp
subversion Subversion dest should allow ~ expansion 2012-09-04 10:15:13 +10:00
supervisorctl Use get_bin_path properly 2012-08-31 15:03:26 -04:00
template
user Add option required=(True|False) to get_bin_path and update modules 2012-08-30 11:01:37 -07:00
virt
wait_for chmod +x 2012-08-30 19:43:14 -04:00
yum