Hi,
I developed an Ansible playbook to launch an instance on OpenStack.
I have this block:
---
- name: launch an instance
hosts: localhost
gather_facts: false
tasks:
- name: launch an instance
os_server:
state: present
auth:
auth_url: https://auth.cloud.ovh.net/v2.0/
username: secret
password: secret
project_name: 7321722640570976
region_name: SBG3
name: mariadbserver-01
image: CentOS 7
state: present
network: Ext-Net
flavor: s1-2
key_name: DBaaSOVHKey
meta:
hostname: mariadb
register: newnode
- name: Show Server's IP
debug: var=newnode.openstack.public_v4
#Here i want to add a section mariadbservers and add the public IP address
to this section
- name: Register the hosts in the inventory
add_host:
hostname: "{{ newnode.openstack.public_v4 }}}"
group: "{{ mariadbservers }}"
I have this error:
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args'
has an invalid value, which appears to include a variable that is
undefined. The error was: 'mariadbservers' is undefined\n\nThe error
appears to have been in
'/home/soufiane/DBaaS/ansible-role-dbaas/roles/novaserver/tasks/main.yml':
line 28, column 5, but may\nbe elsewhere in the file depending on the exact
syntax problem.\n\nThe offending line appears to be:\n\n\n - name:
Register the hosts in the inventory\n ^ here\n"}
____________________
Any ideas
--
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/5c2cd930-3b39-4b65-9ad5-940567fde89e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.