so from the code, this should work when ansible_distribution":
"CentOS" but not when ansible_distribution": "CentOS Linux"
There’s a class for ‘Centos’ at line 449, and another for ‘Centos linux’ at line 458, if you are looking at the Hostname module.
So i checked again, i had misread the code it does not match class
name but the declared distribution variable inside, this SHOULD match
all versions of Centos.
just tested on a new 7.1 vm and hostname module works w/o any issues.
What version Ansible are you using? I only have the AWS instance (no other installs) I provisioned today that’s 7.1 right now, but it’s the latest one to have failed.
I am wondering if the version of python on my control machine would make a difference. I don’t know why it would, but it’s odd that every (Centos) host I point to has the same problem, when you and gregswift have both succeeded with 7.1 targets. My control machine is Slackware 14.1. Its Python version is 2.7.3.
I’ll mull it over and likely try using a different control machine next…Ubuntu or CentOS.
I should write a playbook to clone all my repos/roles from bitbucket, github, and galaxy so it’s easier to migrate controllers.
Thanks!
Joanna
in this case the version of python on ansible machine should not
matter, the module executes on the target machine. The version of
ansible might matter as many changes were made to hostname module, I'm
using 2.0/devel from git.
I did a fresh install on a new CentOS 7.1.1503. I got the same error response to the hostname module from my Slackware control machine.
I installed ansible 1.9.3 and git cloned enough over to my Ubuntu 14.04 laptop to rerun the same playbook against the same CentOS 7.1 target. The error was gone. All my CentOS targets respond just fine to my Ubuntu control machine. So…something is wonky with the control machine. It is running Slackware, so I’m not surprised.
Thanks for troubleshooting with me!
Joanna