TASK: [ansible-ipaserver | Hard set the hostname]
*****************************
failed: [xxxx2] => {"failed": true}
msg: hostname module cannot be used on platform Linux (Centos linux)
failed: [xxxx5] => {"failed": true}
msg: hostname module cannot be used on platform Linux (Centos linux)
failed: [xxxx3] => {"failed": true}
msg: hostname module cannot be used on platform Linux (Centos linux)
Python output:
>>> print(platform.system())
Linux
>>> print(platform.dist())
('centos', '7.1.1503', 'Core')
>>> print(platform.linux_
distribution())
('CentOS Linux', '7.1.1503', 'Core')
On Friday, November 13, 2015 at 3:10:19 PM UTC-6, Joanna Delaporte wrote:
>
> HI Brian,
>
> Thanks! Both hosts had the same responses. Here's the result:
>
> >>> print(platform.system())
> Linux
> >>> print(platform.linux_distribution())
> ('CentOS Linux', '7.0.1406', 'Core')
> >>> print(platform.dist())
> ('centos', '7.0.1406', 'Core')
>
> So, if the module is first looking at platform.system and taking any
> answer it receives, the only answer the module receives from this
> distribution version is "Linux".
>
> On Friday, November 13, 2015 at 1:41:24 PM UTC-6, Brian Coca wrote:
>>
>> the 'magic' gets done in the load_platform_subclass, which matches the
>> platform name to a class of the same name + Hostname, which then sets
>> the strategy class, which actually implements the way of updating
>> hostname.
>>
>> to figure out platform name it uses platform.system() built in from
>> python. can you do test the output of this in your instance? also
>> platform.linux_distribution() and platform.dist() which might be used
>> as fallbacks.
>>
>> --
>> Brian Coca
>>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c47e6e3a-1294-45d1-909c-aa4b6ab86400%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.