Hot answers tagged

3

Try this, to run an adhoc command with IP address ansible all -i 192.168.254.150, -m ping 192.168.254.150 | SUCCESS => { "changed": false, "ping": "pong" } From man: -i INVENTORY, --inventory=INVENTORY, --inventory-file=INVENTORY specify inventory host path or comma separated host


1

You might want to use the group vars feature, so that your playbooks stay clean and re-usable. You define a storageservers group in your inventory; associated with this group, Ansible will look for group_vars/storageservers.yml for the vars to associate with this group. Here, you can set the variables: # group_vars/storageservers.yml --- partitions: - ...


1

Your very first role include does not have variables provided with it, so it will fail. Here's an excerpt from above showing this. Notice lines 1-2 have no variables after them (unlike the include following that which does correctly provide the variables). - include_role: name: gluster-node-partition - name: Create data1 partition include_role: ...


1

As @JSapkota mentioned the URL was wrong. It must be https://keycloak-server/auth/admin/realms. - name: "Create Realm for service Keycloak" uri: url: "https://keycloak-server/auth/admin/realms" method: POST src: "realm.json" remote_src: "no" status_code: - 201 headers: Content-type: "application/json" Accept: "...


1

The keyword hosts is missing. Also colons : are needed after the hostnames. Fix the syntax, for example all: children: control: hosts: moriarty.server.com: toby.server.com: managed: hosts: sherlock.server.com: See How to build your inventory.


1

I have been writing a few playbooks and roles to automate the installation of servers in my network, but the initial request for a certificate from LE has always proven cumbersome. E.g. For a dns-01 challenge, your dns configuration must have been propagated upstream or certbot will fail. I am now considering to use the native acme_* modules to acquire the ...


Only top voted, non community-wiki answers of a minimum length are eligible