Commit graph

31 commits

Author SHA1 Message Date
Jonathan Mainguy
c0966eee7c Fixes issue #8339 where Scientific Linux incorrectly tries to use FedoraStrategy of hostnamectl 2014-08-02 15:38:52 -04:00
Bjorn Neergaard
adcdbdf894 Wrap get_distribution_version() in the hostname module
We wrap get_distribution_version() with a new function,
_get_distribution_version(), that returns `0` when the result is a string or
`None`.

This accounts for the case when get_distribution_version() returns a string,
and we try to compare it to a float. We do this in the hostname module instead
of the module snippets because other modules may want the real string
version.module snippets because other modules may want the real string version.
2014-07-28 11:16:30 -05:00
James Cammarata
d1d318b028 Merge pull request #8308 from robinro/extend-hostname-distrolist
Extended distributions list for hostname module
2014-07-28 09:12:59 -05:00
Robin Roth
e91c318327 Fix extra newline at end of hostname for Fedora
This fixes a bug introduced by 138b45e3.
The hostname has an additional newline at the end which leads to the
state always being 'changed: true' even if the hostname is unchanged.
2014-07-28 15:22:10 +02:00
Robin Roth
7a09f87b8c Extended distributions list for hostname module
Implementations already present
2014-07-28 15:19:41 +02:00
Ruggero Marchei
8904c61932 fix LooseVersion exception with empty distribution_version 2014-07-16 07:55:20 +02:00
Ruggero Marchei
d6bca15aa5 fix issue #8102 2014-07-15 01:26:44 +02:00
Ruggero Marchei
e3f5af377f move get_distribution_version() to basic.py 2014-06-17 10:22:14 +02:00
Ruggero Marchei
c53c6a507a use different strategy for RHEL >= 7. Fixes 7763 2014-06-14 19:29:04 +02:00
Olivier Louvignes
8051e12490 Add support for Linaro distribution in hostname module 2014-06-12 12:06:59 +02:00
Cristian Ciupitu
138b45e32f hostname module: don't filter hostnamectl with awk
There's no need to filter hostnamectl's output with awk because its man
page says:

    hostnamectl [OPTIONS...] {COMMAND}

       --static, --transient, --pretty
	   If status is used (or no explicit command is given) and one
	   of those fields is given, hostnamectl will print out just
           this selected hostname.

E.g. hostnamectl --static status => ansible.example.org
2014-03-16 13:10:28 -04:00
Michael DeHaan
4e8b97ddeb More shell updates 2014-03-12 17:31:00 -04:00
rishid
34f9349b5e Add support for Scientific Linux for hostname module
hostname module was lacking support for Scientific Linux, this commit adds it.
2014-01-16 16:08:51 -05:00
James Tanner
dee960716b Fixes #5353 create etc/hostname file in debian if it does not exist 2014-01-07 15:53:16 -05:00
David Hummel
cc3678730c Fix issue #5214: hostname persistence on RedHat/CentOS 2013-12-07 21:10:42 -05:00
jctanner
2670529671 Merge pull request #5090 from dragon3/hostname_support_amazon_linux
hostname module: add support for Amazon Linux
2013-12-03 12:34:55 -08:00
jctanner
ef92b2cb12 Merge pull request #5063 from samh/devel
Fixed hostname module for RHEL6 Workstation
2013-12-02 13:38:32 -08:00
James Tanner
6000d636b3 Fixes #5023 Convert all modules to use new snippet import pattern 2013-12-02 15:11:23 -05:00
dragon3
d39e6fda92 hostname module: add support for Amazon Linux 2013-11-28 09:31:25 +09:00
Sam Hartsfield
ae7735b45d Fixed hostname module for RHEL6 Workstation 2013-11-26 11:36:10 -05:00
James Tanner
1d24bcc916 Fix pep8 error in hostname module 2013-11-19 16:39:48 -05:00
Hiroaki Nakamura
63a552b2d3 Apply the same change as https://github.com/hnakamur/ansible-playbooks/pull/2 2013-11-10 08:28:33 +09:00
James Tanner
fa62ee46bf Set the correct version added for the hostname module 2013-11-07 22:01:02 -05:00
Hiroaki Nakamura
abed2c47fa Fix for RHEL6. 2013-11-01 23:32:14 +09:00
Hiroaki Nakamura
54243dc8f5 Add support for Fedora, OpenSUSE and ArchLinux.
Tested under Fedora 19 and OpenSUSE 12.3. Not tested on ArchLinux.
2013-10-16 01:15:47 +09:00
Hiroaki Nakamura
8c5eb96de4 Do not use shortcut conditional operator which is not supported in Python 2.4. 2013-10-15 23:41:49 +09:00
Hiroaki Nakamura
a0da0afe00 Fix a bug in DebianStrategy.get_permanent_hostname(). Use strip, not split! 2013-08-25 07:46:23 +09:00
Hiroaki Nakamura
4f91238e34 Rewrite with "try ... finally" instead of "with" statement to support Python 2.4. 2013-08-25 07:44:18 +09:00
Hiroaki Nakamura
3b1d7d88b5 Remove extra sysloggings. 2013-08-25 07:35:20 +09:00
Hiroaki Nakamura
f4ba0e78a4 Raise an error on unsupported platform/distributions. 2013-08-25 07:32:37 +09:00
Hiroaki Nakamura
ce2b37e2ff Add a hostname module, which sets system's hostname. 2013-08-25 00:49:15 +09:00