0
Rate this Quest
Could you send more debug messages? I think you should delegate the
task to localhost instead of use "connection: local".
It's likely due to your connection parameters.
First, take a look at your "server" parameter. You're specifying
inventory_hostname for it, so the module expects that the value that
is eventually dropped there (the host in "mygroups" is resolvable in
either DNS or your hosts file). For example,
[mygroups[
bigip1
bigip2
If either of the above do not respond with a ping (ie, ping bigip1)
then ansible will fail too.
Alternatively, if you are using IP addresses for your host entries, ala
[mygroups]
1.1.1.1
2.2.2.2
Then, again, your ansible controller needs to be able to ping them.
Specifying "connection: local" and "delegate_to: localhost" are
(almost) two ways of saying the same thing. Both run the task locally
on your box, the exception is that with connection: local it happens
for _all_ tasks. Where-as delegate_to: localhost it only happens with
the task that is tagged with delegate_to. Also, connection: local is
useful for BIG-IP versions less than 12 because it stops the failure
of gather_facts (alternatively set gather_facts: false to stop the
failure). So you can use either connection: local or delegate_to:
localhost, but you do not need to use both.
The next problem is that you have a username of "root" specified in your task.
The root user has no TMUI (web) equivalent. So you cannot log into the
box with root over REST. All of the F5 modules use REST by default. So
if you are using the modules, you (almost) always want to specify the
'admin' account, not the 'root' account. Things change slightly on
12.x where-in you can specify any account with the Administrator role,
prior to 12.x, you must specify 'admin' specifically.
The last thing I would look at is your mention of SSH. If you do
indeed want to use SSH to connect to the box, the _only_ module that
supports this is bigip_command. To make use of SSH specifically
though, you need to set "transport: cli" in your task. This overrides
the default "transport: rest" and attempts an SSH connection. Continue
to use either "connection: local" or "delegate_to: localhost" when you
use "transport: cli".
If the problem persists, the F5 provides more 1x1 support by visiting
their Github issue tracker for their F5 modules found here
https://github.com/F5Networks/f5-ansible
I know this because I work there and I'm the one that writes all these modules.
Hope that helps,
-tim