Commit Graph

154 Commits (288a5c9a777311f1f46cf107813bd2da579b48a0)

Author SHA1 Message Date
Brian Coca f8a36c4047 service goes back to failing when absent
if no tools and no init script, this should always fail
2016-12-08 11:23:53 -05:00
Brian Coca f435f887fa better handling of checkmode for solaris fixes #2296 2016-12-08 11:23:51 -05:00
tobbe 65f12bccb6 add text to the description, more user friendly 2016-12-08 11:23:51 -05:00
tobbe 455da45e62 Add suport for selinux user when adding a new user on selinux enabled systems 2016-12-08 11:23:51 -05:00
Michael Scherer 55f2345829 Remove a unneeded use of use_unsafe_shell
Since use_unsafe_shell is suspicious from a security point
of view (or it wouldn't be unsafe), the less we have, the less
code we have to toroughly inspect for a security audit.
2016-12-08 11:23:51 -05:00
nitzmahone 0d0b78dd1e fixed disappearing groups on OSX user module
Ensure that we don't try to modify the groups collection if groups are not specified
2016-12-08 11:23:51 -05:00
Dominique Barton 5c05016d1e bugfix for issue #2537 2016-12-08 11:23:51 -05:00
Sina Sadeghi 2ad9c6c9e5 Update hostname.py
Added support for FreeBSD. (http://www.freebsd.org)
2016-12-08 11:23:50 -05:00
Brian Coca b3c14ee0c3 minor doc fixes and reformating updated validate_certs feature to be 2.1 2016-12-08 11:23:50 -05:00
Veaceslav (Slava) Mindru 2eb6b566b2 Squashed commit of the following:
commit 406214fad214359fcf13fe8c7cd3f8f8faac5386
commit 85d1c9b0a41dd075eb2683b1a7de595ca3119614
commit 4aa5049b5ae25dee71a248238201611a466a13c4
commit 65a96974c80aea1fef88d78e218ecb665d8113e1
commit 22ea5863d1dfd628735b46cc7de51c0fd33251de

Refactoring
2016-12-08 11:23:49 -05:00
Martin André aaa82d1942 Fix typo in ping module short description 2016-12-08 11:23:49 -05:00
Jordi De Groof 7aa57219f6 Update facts when hostname is changed
ansible_hostname contains the unqualified hostname
2016-12-08 11:23:48 -05:00
Greg DeKoenigsberg f08d60388c @bradobro stepping down as maintainer 2016-12-08 11:23:47 -05:00
Brian Coca d2cffb31c3 rearranged systemd check, removed redundant systemctl check fixed unused cmd and state var assignements 2016-12-08 11:23:44 -05:00
Simon Hafner 923e442409 added earlier paths to systemd
2b583ce657
b925e72633
2016-12-08 11:23:43 -05:00
Simon Hafner 4af48e139c simpler way to check if systemd is the init system
According to
http://www.freedesktop.org/software/systemd/man/sd_booted.html
check if the directory /run/systemd/system/ exists.
2016-12-08 11:23:43 -05:00
Brian Coca 505467d2ff clarified ping module purpose 2016-12-08 11:23:42 -05:00
Toshio Kuratomi 80b3bbd55e Mark a few parameters as no_log 2016-12-08 11:23:42 -05:00
Achilleas Pipinellis 961082620c Add missing documentation: cron_file requires user to be set 2016-12-08 11:23:40 -05:00
gekmihesg d003fcd662 Support sysctl on OpenBSD
Fixes #1233
2016-12-08 11:23:39 -05:00
Simon Li 607b7c14bd Fix incorrect variable in group.py: user -> group 2016-12-08 11:23:39 -05:00
Brian Coca 45907f2ff3 removed typo 2016-12-08 11:23:38 -05:00
Brian Coca d55ba3ab7c removed syslog in favor of common module logging functions 2016-12-08 11:23:38 -05:00
Brian Coca 682cb99d45 revert must_exist 2016-12-08 11:23:38 -05:00
Mike Boone dd76088019 Updated link to the FAQ. 2016-12-08 11:23:36 -05:00
Brian Coca 99159b3cdd changed chmod to 2.4 compat 2016-12-08 11:23:35 -05:00
Brian Coca 917b7071d6 partially reverted previous change to deal with systemctl show status not returning errors on missing service Now it looks for not-found key instead of running status which does return error codes when service is present but in diff states. fixes #12216 2016-12-08 11:23:34 -05:00
Brian Coca fd23120d42 check systemctl status before show as show will not return antyhing other than rc=0 even when it fails. 2016-12-08 11:23:34 -05:00
Marius Gedminas b2fc74337a authorized_key: fix example in documentation
'key=' cannot be pointing to a file name; it needs to be the key itself as a string (or a URL).
2016-12-08 11:23:33 -05:00
Tim Rupp 223cac3f39 Add hostname support for Kali linux 2.0
This patch allows the hostname module to detect and set the hostname for a
Kali Linux 2.0 installation. Without this patch, the hostname module raises
the following error

   hostname module cannot be used on platform Linux (Kali)

Kali is based off of Debian.
2016-12-08 11:23:33 -05:00
Marius Gedminas f97d00fbad user: don't generate SSH keys in check mode
Fixes https://github.com/ansible/ansible/issues/11768

Test plan:

- (in a Vagrant VM) created a user 'bob' with no ssh key
- ran the following playbook in check mode:

    ---
    - hosts: trusty
      tasks:
        - user: name=bob state=present generate_ssh_key=yes

- saw that ansible-playbook reported "changes=1"
- saw that /home/bob/.ssh was still absent
- ran the playbook for real
- saw that /home/bob/.ssh was created
- ran the playbook in check mode again
- saw that ansible-playbook reported no changes
- tried a variation with a different username for a user that didn't
  exist: ansible-playbook --check worked correctly (no errors, reported
  "changed")
2016-12-08 11:23:33 -05:00
Simon Li 28c44c554c Don't fail in check_mode if user exists
PR #1651 fixed issue #1515 but the requirement for path to be defined is unecessarily strict. If the user has previously been created a path isn't necessary.
2016-12-08 11:23:33 -05:00
Александр Костырев ec8a94f748 Fix documentation of authorized_key.py
man for sshd http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/sshd.8?query=sshd
says there's no "host" option but "from".
2016-12-08 11:23:31 -05:00
Brian Coca 34f8eb0f4c made continue into a pass (there was no loop) 2016-12-08 11:23:30 -05:00
Brian Coca 686026919e avoid shlex exceptions in rc parsing (happens with multiline entries) fixes #1898 2016-12-08 11:23:30 -05:00
Evgeny Vereshchagin fe840225fb Fix service.enable on: Debian 8, Ubuntu 15.04
Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751638
See https://github.com/systemd/systemd/issues/937
2016-12-08 11:23:30 -05:00
Austin Hyde ca512b5def Always end rc.conf entries with a new line 2016-12-08 11:23:30 -05:00
Evan Kaufman b3495e238c Add disabled option to cron module 2016-12-08 11:23:29 -05:00
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
Brian Coca 7d660adb39 changed verbose override variable 2016-12-08 11:23:27 -05:00
James Cammarata 05c6732462 Prefer non-zero rc's over text analyis in service status checks
Fixes ansible/ansible#10441
2016-12-08 11:23:26 -05:00
saito-hideki 19cd35806f Add Solaris support in hostname module
feature_pull_request: #1804
2016-12-08 11:23:26 -05:00
KIKUCHI Koichiro dab7305d3b Fix service enabled check failure on FreeBSD 2016-12-08 11:23:25 -05:00
Sébastien Gross 0fd3ece053 Allow '*' as empty password.
If `password` is defined as `*` `useradd` or `usermod` returns an error:

    msg: usermod: Invalid password: `*'

This works very well on Linux host to not define any password for a
user (mainly useful if your setup is only based on SSH keys for
auth). On OpenBSD this does not work, so we have to ignore the encrypted
password parameter if it defined as `*`.
2016-12-08 11:23:25 -05:00
fti7 581ce7dd32 mount: Support for Check-Mode 2016-12-08 11:23:24 -05:00
Brian Coca 7a6c8251dd prevent usless assignment of home 2016-12-08 11:23:22 -05:00
bambou ac41e7c669 Check if the gid is set 2016-12-08 11:23:22 -05:00
Mischa ter Smitten 10cae0acb3 The tilde expansion doesn't work with user.home 2016-12-08 11:23:21 -05:00
Sean Chittenden 4c8b573e2c Fix group mod and group add for FreeBSD 2016-12-08 11:23:18 -05:00
0tmc 6e4c5e0a12 Use of proper fstab file on FreeBSD 2016-12-08 11:23:17 -05:00