Re: [ansible-project] Ansible for openstack

2019-08-05 Thread Rahul Kumar
Hi dick
I am using Red hat distribution of Openstack.
And openstack --verison =3.19.0

Though , Currently i am just targeting one instance (and not even stack)
for starting purpose and i want to use
only red hat openstack platform and no other provider.

On Mon, 5 Aug 2019 at 13:56, Dick Visser  wrote:

> I have access to various Openstack clusters from different providers
> and I found it was very much dependent on the way the cluster has been
> setup, and also what version of openstack component were used.
> It was hard to create a generic role/playbook that works well across
> those providers.
> Similarly, because of the different dependencies, destroying resources
> was non-trivial, each provider was different.
>
> Dick
>
> On Mon, 5 Aug 2019 at 09:49, Rahul Kumar  wrote:
> >
> > Thanks Sebastien . I removed instance. but rest of all resources , i am
> not able to predict order, below is my playbook:
> > ---
> > - name: Create a test environment
> >   hosts: localhost
> >   vars:
> > cert_auth:
> >   ca_cert: /root/cabs12.crt
> >   tasks:
> > - name: Remove security group rule for ping
> >   os_security_group_rule:
> > cloud: mycloud
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > security_group: test-security-group
> > protocol: icmp
> > state: absent
> > remote_ip_prefix: 0.0.0.0/0
> >
> > - name: Remove security group rule for SSH
> >   os_security_group_rule:
> > cloud: mycloud
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > security_group: test-security-group
> > protocol: tcp
> > state: absent
> > port_range_min: 22
> > port_range_max: 22
> > remote_ip_prefix: 0.0.0.0/0
> >
> > - name: Remove  instance
> >   os_server:
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > cloud: mycloud
> > name: test-instance
> > image: myimage
> > key_name: dump_key
> > timeout: 200
> > flavor: v8.m4
> > network: test-network
> > auto_ip: yes
> > security_groups:
> >   - test-security-group
> >   register:
> > my_instance
> >
> >- name: Remove subnet
> >   os_subnet:
> > cloud: mycloud
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > network_name: test-network
> > name: test-subnet
> >
> > - name: Remove security group
> >   os_security_group:
> > cloud: mycloud
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > name: test-security-group
> > description: Security group for our test instances
> >
> > - name: Remove a router
> >   os_router:
> > cloud: mycloud
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > name: test-router
> > network: ext-net
> > interfaces:
> >   - test-subnet
> >
> > - name: Remove network
> >   os_network:
> > cloud: mycloud
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > name: test-network
> > external: false
> > wait: yes
> >
> > - name: Remove new keypair from current user's default SSH key
> >   os_keypair:
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > name: dump_key
> > public_key_file: "{{ '~' | expanduser }}/.ssh/id_rsa.pub"
> >
> >
> > - name: Remove Cloud Image from Openstack
> >   os_image:
> > name: myimage
> > container_format: bare
> > cloud: mycloud
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > disk_format: qcow2
> > state: absent
> > is_public: no
> > filename: /root/tas/cirros-0.3.4-x86_64-disk.img
> >
> > - name: Remove security group
> >   os_security_group:
> > cloud: mycloud
> > state: absent
> > ca_cert: "{{ cert_auth.ca_cert }}"
> > name: test-security-group
> > description: Security group for our test instances
> >
> > On Mon, 5 Aug 2019 at 13:09, Sebastian Meyer 
> wrote:
> >>
> >> Hi Rahul,
> >>
> >> everything is connected to the instance, no? You can't deprovision sec
> >> groups, network stuff or key_pairs while they are in use.
> >>
> >> You'll have to remove the instance first.
> >>
> >> Regards
> >> Sebastian
> >>
> >> On 05.08.19 09:19, Rahul Kumar wrote:
> >> > Hi All,
> >> > I have provisoned one instance with following order in openstack using
> >> > Ansible:
> >> > 1. Download cloud image
> >> > 2. upload cloud image in Openstack
> >> > 3. created key pair
> >> > 4. created network
> >> > 5. created subnet
> >> > 6. created router
> >> > 7. created security group
> >> > 8. created SG rule
> >> > 9. created instance
> >> >
> >> > and it went successfully. Now i want to remove the resources what
> order i
> >> > should follow:
> >> > I tried 1 task and it is success
> >> > 1. delete SG

Re: [ansible-project] Ansible for openstack

2019-08-05 Thread Dick Visser
I have access to various Openstack clusters from different providers
and I found it was very much dependent on the way the cluster has been
setup, and also what version of openstack component were used.
It was hard to create a generic role/playbook that works well across
those providers.
Similarly, because of the different dependencies, destroying resources
was non-trivial, each provider was different.

Dick

On Mon, 5 Aug 2019 at 09:49, Rahul Kumar  wrote:
>
> Thanks Sebastien . I removed instance. but rest of all resources , i am not 
> able to predict order, below is my playbook:
> ---
> - name: Create a test environment
>   hosts: localhost
>   vars:
> cert_auth:
>   ca_cert: /root/cabs12.crt
>   tasks:
> - name: Remove security group rule for ping
>   os_security_group_rule:
> cloud: mycloud
> ca_cert: "{{ cert_auth.ca_cert }}"
> security_group: test-security-group
> protocol: icmp
> state: absent
> remote_ip_prefix: 0.0.0.0/0
>
> - name: Remove security group rule for SSH
>   os_security_group_rule:
> cloud: mycloud
> ca_cert: "{{ cert_auth.ca_cert }}"
> security_group: test-security-group
> protocol: tcp
> state: absent
> port_range_min: 22
> port_range_max: 22
> remote_ip_prefix: 0.0.0.0/0
>
> - name: Remove  instance
>   os_server:
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> cloud: mycloud
> name: test-instance
> image: myimage
> key_name: dump_key
> timeout: 200
> flavor: v8.m4
> network: test-network
> auto_ip: yes
> security_groups:
>   - test-security-group
>   register:
> my_instance
>
>- name: Remove subnet
>   os_subnet:
> cloud: mycloud
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> network_name: test-network
> name: test-subnet
>
> - name: Remove security group
>   os_security_group:
> cloud: mycloud
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> name: test-security-group
> description: Security group for our test instances
>
> - name: Remove a router
>   os_router:
> cloud: mycloud
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> name: test-router
> network: ext-net
> interfaces:
>   - test-subnet
>
> - name: Remove network
>   os_network:
> cloud: mycloud
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> name: test-network
> external: false
> wait: yes
>
> - name: Remove new keypair from current user's default SSH key
>   os_keypair:
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> name: dump_key
> public_key_file: "{{ '~' | expanduser }}/.ssh/id_rsa.pub"
>
>
> - name: Remove Cloud Image from Openstack
>   os_image:
> name: myimage
> container_format: bare
> cloud: mycloud
> ca_cert: "{{ cert_auth.ca_cert }}"
> disk_format: qcow2
> state: absent
> is_public: no
> filename: /root/tas/cirros-0.3.4-x86_64-disk.img
>
> - name: Remove security group
>   os_security_group:
> cloud: mycloud
> state: absent
> ca_cert: "{{ cert_auth.ca_cert }}"
> name: test-security-group
> description: Security group for our test instances
>
> On Mon, 5 Aug 2019 at 13:09, Sebastian Meyer  wrote:
>>
>> Hi Rahul,
>>
>> everything is connected to the instance, no? You can't deprovision sec
>> groups, network stuff or key_pairs while they are in use.
>>
>> You'll have to remove the instance first.
>>
>> Regards
>> Sebastian
>>
>> On 05.08.19 09:19, Rahul Kumar wrote:
>> > Hi All,
>> > I have provisoned one instance with following order in openstack using
>> > Ansible:
>> > 1. Download cloud image
>> > 2. upload cloud image in Openstack
>> > 3. created key pair
>> > 4. created network
>> > 5. created subnet
>> > 6. created router
>> > 7. created security group
>> > 8. created SG rule
>> > 9. created instance
>> >
>> > and it went successfully. Now i want to remove the resources what order i
>> > should follow:
>> > I tried 1 task and it is success
>> > 1. delete SG rule
>> >
>> > after that i am getting stuck because anything i try to delete , it has
>> > association with some other resource.
>> >
>> > Help me
>> >
>>
>> --
>> Sebastian Meyer
>> Linux Consultant & Trainer
>> Mail: me...@b1-systems.de
>>
>> B1 Systems GmbH
>> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
>> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>>
>>
>> -- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
>>  https://openstack-tage.de (Code DOST-B1) 
>>
>> --
>> You received this message because you

Re: [ansible-project] Ansible for openstack

2019-08-05 Thread Rahul Kumar
Thanks Sebastien . I removed instance. but rest of all resources , i am not
able to predict order, below is my playbook:
---
- name: Create a test environment
  hosts: localhost
  vars:
cert_auth:
  ca_cert: /root/cabs12.crt
  tasks:
- name: Remove security group rule for ping
  os_security_group_rule:
cloud: mycloud
ca_cert: "{{ cert_auth.ca_cert }}"
security_group: test-security-group
protocol: icmp
state: absent
remote_ip_prefix: 0.0.0.0/0

- name: Remove security group rule for SSH
  os_security_group_rule:
cloud: mycloud
ca_cert: "{{ cert_auth.ca_cert }}"
security_group: test-security-group
protocol: tcp
state: absent
port_range_min: 22
port_range_max: 22
remote_ip_prefix: 0.0.0.0/0

- name: Remove  instance
  os_server:
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
cloud: mycloud
name: test-instance
image: myimage
key_name: dump_key
timeout: 200
flavor: v8.m4
network: test-network
auto_ip: yes
security_groups:
  - test-security-group
  register:
my_instance

   - name: Remove subnet
  os_subnet:
cloud: mycloud
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
network_name: test-network
name: test-subnet

- name: Remove security group
  os_security_group:
cloud: mycloud
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
name: test-security-group
description: Security group for our test instances

- name: Remove a router
  os_router:
cloud: mycloud
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
name: test-router
network: ext-net
interfaces:
  - test-subnet

- name: Remove network
  os_network:
cloud: mycloud
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
name: test-network
external: false
wait: yes

- name: Remove new keypair from current user's default SSH key
  os_keypair:
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
name: dump_key
public_key_file: "{{ '~' | expanduser }}/.ssh/id_rsa.pub"


- name: Remove Cloud Image from Openstack
  os_image:
name: myimage
container_format: bare
cloud: mycloud
ca_cert: "{{ cert_auth.ca_cert }}"
disk_format: qcow2
state: absent
is_public: no
filename: /root/tas/cirros-0.3.4-x86_64-disk.img

- name: Remove security group
  os_security_group:
cloud: mycloud
state: absent
ca_cert: "{{ cert_auth.ca_cert }}"
name: test-security-group
description: Security group for our test instances

On Mon, 5 Aug 2019 at 13:09, Sebastian Meyer  wrote:

> Hi Rahul,
>
> everything is connected to the instance, no? You can't deprovision sec
> groups, network stuff or key_pairs while they are in use.
>
> You'll have to remove the instance first.
>
> Regards
> Sebastian
>
> On 05.08.19 09:19, Rahul Kumar wrote:
> > Hi All,
> > I have provisoned one instance with following order in openstack using
> > Ansible:
> > 1. Download cloud image
> > 2. upload cloud image in Openstack
> > 3. created key pair
> > 4. created network
> > 5. created subnet
> > 6. created router
> > 7. created security group
> > 8. created SG rule
> > 9. created instance
> >
> > and it went successfully. Now i want to remove the resources what order i
> > should follow:
> > I tried 1 task and it is success
> > 1. delete SG rule
> >
> > after that i am getting stuck because anything i try to delete , it has
> > association with some other resource.
> >
> > Help me
> >
>
> --
> Sebastian Meyer
> Linux Consultant & Trainer
> Mail: me...@b1-systems.de
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
>
> -- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
>  https://openstack-tage.de (Code DOST-B1) 
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3c5f570b-09ee-0344-0b26-d9bd0d588bc3%40b1-systems.de
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEys2%2B0xc4w3knDQMp2Kg_-FCJToUUd0pMo3St_

Re: [ansible-project] Ansible for openstack

2019-08-05 Thread Sebastian Meyer
Hi Rahul,

everything is connected to the instance, no? You can't deprovision sec
groups, network stuff or key_pairs while they are in use.

You'll have to remove the instance first.

Regards
Sebastian

On 05.08.19 09:19, Rahul Kumar wrote:
> Hi All,
> I have provisoned one instance with following order in openstack using
> Ansible:
> 1. Download cloud image
> 2. upload cloud image in Openstack
> 3. created key pair
> 4. created network
> 5. created subnet
> 6. created router
> 7. created security group
> 8. created SG rule
> 9. created instance
> 
> and it went successfully. Now i want to remove the resources what order i
> should follow:
> I tried 1 task and it is success
> 1. delete SG rule
> 
> after that i am getting stuck because anything i try to delete , it has
> association with some other resource.
> 
> Help me
> 

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
 https://openstack-tage.de (Code DOST-B1) 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3c5f570b-09ee-0344-0b26-d9bd0d588bc3%40b1-systems.de.


[ansible-project] Ansible for openstack

2019-08-05 Thread Rahul Kumar
Hi All,
I have provisoned one instance with following order in openstack using
Ansible:
1. Download cloud image
2. upload cloud image in Openstack
3. created key pair
4. created network
5. created subnet
6. created router
7. created security group
8. created SG rule
9. created instance

and it went successfully. Now i want to remove the resources what order i
should follow:
I tried 1 task and it is success
1. delete SG rule

after that i am getting stuck because anything i try to delete , it has
association with some other resource.

Help me

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEx1f7jFdZ%2BR82jabVX3FUVyOTC6FB5LWdo%2BM9GakY77QQ%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Rahul Kumar
Thanks much Sebastien,
Good inputs.
I tried same playbook by making state = absent  and got error as expected
as below:
fatal: [localhost]: FAILED! => {"changed": false, "msg":
"ConflictException: 409: Client Error for url:
https://:/v2.0/networks/c4e67037-e32d-4e06-b0ba-7c07f6e1ec63.json,
Unable to complete operation on network
c4e67037-e32d-4e06-b0ba-7c07f6e1ec63. There are one or more ports still in
use on the network."}

So again some questions:
1. Do we need to write different playbook for deleting resources or either
flip the order in the playbook as needed and make state=absent?
2. I tried this just to create 1 nova instnace . Assume we have multiple
resources and we need to make sure right resource is attached to particular
one.
For example:
Assume 2 resources:

- name: Create Networks
  os_network:
name: "{{ item.name }}"
state: present
external: false
wait: yes
  with_items: "{{ networks }}"

  os_server:
 name: "{{ prefix }}-{{ item.name }}"
 state: present
 key_name: "{{ item.key }}"
 availability_zone: "{{ item.availability_zone }}"
 nics: "{{ item.nics }}"
 image: "{{ item.image }}"
 flavor: "{{ item.flavor }}"
  with_items: "{{ servers }}"
  register: "os_hosts"


Assume network is need to provision instance . Now say we have multiple
instances and multiple networks .Which we can define using networks and
servers variables as shown in above snippet.
How do i ensure that one particular network is assigned to particular
instance? do we need to manage this at
variables side defination only or is there any better way to handle same in
playbook code?

Its just scaling use case when we have multiple resources and we want that
expected resource is attached to right one.


On Thu, 1 Aug 2019 at 16:06, Sebastian Meyer  wrote:

> Hi Rahul,
>
> On 01.08.19 12:19, Rahul Kumar wrote:
> > 1. whatever resources(net,subnet,sg,router etc) are provisioned as part
> of
> > this single instance creation , lets say i want to clear all those
> > resources in one shot , how can i do this ?
>
> Each module (os_server, os_network ...) should only create the specified
> resource. For deprovisioning set the state to absent. One exception
> would be e.g. a floating IP automatically assigned to the instance. That
> IP isn't assigned anymore afterwards, but still created.
>
> > 2. Does order of tasks matter in playbook. For example: To create
> instance
> > , we need network , so first we will provision network and then other
> > dependent resources.
>
> Order matters, yes. Playbooks are run from top down, so the first task
> in the list is executed first. Beware that you need a different order
> for creation and destruction, afaik you cant remove a network, if theres
> still an instance on it.
>
> --
> Sebastian Meyer
> Linux Consultant & Trainer
> Mail: me...@b1-systems.de
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
>
> -- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
>  https://openstack-tage.de (Code DOST-B1) 
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/15c36db1-d2bb-536a-3416-5c62b209b96d%40b1-systems.de
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEyuAfc06%2ByxEGpDZpSQKzsz%2BBor7UoV6e2vQCCj2%3DxHsw%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Sebastian Meyer
Hi Rahul,

On 01.08.19 12:19, Rahul Kumar wrote:
> 1. whatever resources(net,subnet,sg,router etc) are provisioned as part of
> this single instance creation , lets say i want to clear all those
> resources in one shot , how can i do this ?

Each module (os_server, os_network ...) should only create the specified
resource. For deprovisioning set the state to absent. One exception
would be e.g. a floating IP automatically assigned to the instance. That
IP isn't assigned anymore afterwards, but still created.

> 2. Does order of tasks matter in playbook. For example: To create instance
> , we need network , so first we will provision network and then other
> dependent resources.

Order matters, yes. Playbooks are run from top down, so the first task
in the list is executed first. Beware that you need a different order
for creation and destruction, afaik you cant remove a network, if theres
still an instance on it.

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
 https://openstack-tage.de (Code DOST-B1) 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/15c36db1-d2bb-536a-3416-5c62b209b96d%40b1-systems.de.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Rahul Kumar
Thanks Sebastien and Dick.
Yes , clouds.yaml can be kept in /etc/openstack/clouds.yaml or
~/.config/openstack/clouds.yaml but not in current
working directory (where playbook resides).
Also we can reference the named cloud directly and no need of
clouds.mycloud variables etc.
I directly used like cloud: mycloud and it worked while keeping my
clouds.yaml in /etc/openstack/clouds.yaml

My complete instance got created (with network ,subnet,SG,Router etc).


I have below question to both experts dick and sebastien .

1. whatever resources(net,subnet,sg,router etc) are provisioned as part of
this single instance creation , lets say i want to clear all those
resources in one shot , how can i do this ?
2. Does order of tasks matter in playbook. For example: To create instance
, we need network , so first we will provision network and then other
dependent resources.

On Thu, 1 Aug 2019 at 15:37, Sebastian Meyer  wrote:

> Hi Rahul,
>
> On 31.07.19 09:36, Rahul Kumar wrote:
> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud
> was
> > not found."}.
> > Notice clouds.yaml and Main Playbook is in same location.
>
> from the module docs:
>
> > Auth information is driven by openstacksdk, which means that values
> can come from a yaml config file in /etc/ansible/openstack.yaml,
> /etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml
>
> Sebastian
>
> --
> Sebastian Meyer
> Linux Consultant & Trainer
> Mail: me...@b1-systems.de
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
>
> -- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
>  https://openstack-tage.de (Code DOST-B1) 
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/4f9f7229-b0ce-6e5b-4c13-2508d2a25a5a%40b1-systems.de
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEz-8uCb%3DEh6dXqwYKHND8S0yTaJman%3Dw3kB8d9wO%3D0isA%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Sebastian Meyer
Hi Rahul,

On 31.07.19 09:36, Rahul Kumar wrote:
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud was
> not found."}.
> Notice clouds.yaml and Main Playbook is in same location.

from the module docs:

> Auth information is driven by openstacksdk, which means that values
can come from a yaml config file in /etc/ansible/openstack.yaml,
/etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml

Sebastian

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis 
 https://openstack-tage.de (Code DOST-B1) 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4f9f7229-b0ce-6e5b-4c13-2508d2a25a5a%40b1-systems.de.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Dick Visser
You should actually include clouds.yaml in the main playbook.


On Thu, 1 Aug 2019 at 10:26, Rahul Kumar  wrote:

> Thanks dick but now it is complaining clouds is undefined.😔
>
> On Thu, 1 Aug 2019 at 1:50 PM, Dick Visser  wrote:
>
>> Actually, it's this:
>>
>> cloud: "{{ clouds.mycloud }}"
>>
>> On Thu, 1 Aug 2019 at 10:03, Rahul Kumar  wrote:
>> >
>> > sorry to come back Dick. It is still not working from clouds.yaml
>> >  "msg": "The task includes an option with an undefined variable. The
>> error was: 'mycloud' is undefined\n\nThe error appears to be in
>> '/root/tas/simpledemo/Main-Playbook.yaml': line 5, column 7, but may\nbe
>> elsewhere in the file depending on the exact syntax problem.\n\nThe
>> offending line appears to be:\n\n  tasks:\n- name: create network\n
>>   ^ here\n"
>> > Though i defined: cloud: "{{ mycloud }}"
>> >
>> > On Wed, 31 Jul 2019 at 15:34, Rahul Kumar 
>> wrote:
>> >>
>> >> Thanks Dick. It worked, I forgot this by mistake.
>> >>
>> >> On Wed, 31 Jul 2019 at 14:56, Dick Visser 
>> wrote:
>> >>>
>> >>> You are using the literal string 'cloud'.
>> >>> Change that entry in the os_network task to:
>> >>>
>> >>>  cloud: "{{ mycloud }}"
>> >>>
>> >>> On Wed, 31 Jul 2019 at 09:37, Rahul Kumar 
>> wrote:
>> >>> >
>> >>> > Hi All,
>> >>> > I am trying to create Openstack instances using Ansible for
>> Openstack.
>> >>> > I have clouds.yaml as below:
>> >>> > clouds:
>> >>> >   mycloud:
>> >>> > auth:
>> >>> >   auth_url: https://:/v3
>> >>> >   project_name: mycloud
>> >>> >   username: mycloud
>> >>> >   project_domain_name: Default
>> >>> >   user_domain_name: Default
>> >>> >   password: mycloudpwd
>> >>> > region_name: regionOne
>> >>> > interface: public
>> >>> > identity_api_version:
>> >>> > and Main Playbook is as below:
>> >>> > ---
>> >>> > - name: Create a test environment
>> >>> >   hosts: localhost
>> >>> >   tasks:
>> >>> > - name: create network
>> >>> >   os_network:
>> >>> > cloud: mycloud
>> >>> > state: present
>> >>> > name: test-network
>> >>> > external: false
>> >>> > wait: yes
>> >>> > -
>> >>> > --
>> >>> > But i am resulting in error:
>> >>> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud
>> mycloud was not found."}.
>> >>> > Notice clouds.yaml and Main Playbook is in same location.
>> >>> >
>> >>> > Thanks
>> >>> > Rahul
>> >>> >
>> >>> > --
>> >>> > 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 ansible-project+unsubscr...@googlegroups.com.
>> >>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com
>> .
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Dick Visser
>> >>> Trust & Identity Service Operations Manager
>> >>> GÉANT
>> >>>
>> >>> --
>> >>> 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 ansible-project+unsubscr...@googlegroups.com.
>> >>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com
>> .
>> >
>> > --
>> > 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 ansible-project+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAGH8rExkcQeBUrPBkn2C4dy3sgP3mD6eBYBAL2dWLG69NxySaA%40mail.gmail.com
>> .
>>
>>
>>
>> --
>> Dick Visser
>> Trust & Identity Service Operations Manager
>> GÉANT
>>
>> --
>> 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 ansible-project+unsubscr...@googlegroups.com.
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMv6ssuLaAqXnPKZMY836rF-Ep59W8WExA41-yObHka8Q%40mail.gmail.com
>> .
>>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEweyyqF0g4Fhzd%3DrferaTp2H7zhj5%3Dhxa4K9HWYKTf8nA%40mail.gmail.com
> 
> .
>
-- 
Sent from a mobile device -

Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Rahul Kumar
Thanks dick but now it is complaining clouds is undefined.😔

On Thu, 1 Aug 2019 at 1:50 PM, Dick Visser  wrote:

> Actually, it's this:
>
> cloud: "{{ clouds.mycloud }}"
>
> On Thu, 1 Aug 2019 at 10:03, Rahul Kumar  wrote:
> >
> > sorry to come back Dick. It is still not working from clouds.yaml
> >  "msg": "The task includes an option with an undefined variable. The
> error was: 'mycloud' is undefined\n\nThe error appears to be in
> '/root/tas/simpledemo/Main-Playbook.yaml': line 5, column 7, but may\nbe
> elsewhere in the file depending on the exact syntax problem.\n\nThe
> offending line appears to be:\n\n  tasks:\n- name: create network\n
>   ^ here\n"
> > Though i defined: cloud: "{{ mycloud }}"
> >
> > On Wed, 31 Jul 2019 at 15:34, Rahul Kumar 
> wrote:
> >>
> >> Thanks Dick. It worked, I forgot this by mistake.
> >>
> >> On Wed, 31 Jul 2019 at 14:56, Dick Visser 
> wrote:
> >>>
> >>> You are using the literal string 'cloud'.
> >>> Change that entry in the os_network task to:
> >>>
> >>>  cloud: "{{ mycloud }}"
> >>>
> >>> On Wed, 31 Jul 2019 at 09:37, Rahul Kumar 
> wrote:
> >>> >
> >>> > Hi All,
> >>> > I am trying to create Openstack instances using Ansible for
> Openstack.
> >>> > I have clouds.yaml as below:
> >>> > clouds:
> >>> >   mycloud:
> >>> > auth:
> >>> >   auth_url: https://:/v3
> >>> >   project_name: mycloud
> >>> >   username: mycloud
> >>> >   project_domain_name: Default
> >>> >   user_domain_name: Default
> >>> >   password: mycloudpwd
> >>> > region_name: regionOne
> >>> > interface: public
> >>> > identity_api_version:
> >>> > and Main Playbook is as below:
> >>> > ---
> >>> > - name: Create a test environment
> >>> >   hosts: localhost
> >>> >   tasks:
> >>> > - name: create network
> >>> >   os_network:
> >>> > cloud: mycloud
> >>> > state: present
> >>> > name: test-network
> >>> > external: false
> >>> > wait: yes
> >>> > -
> >>> > --
> >>> > But i am resulting in error:
> >>> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud
> mycloud was not found."}.
> >>> > Notice clouds.yaml and Main Playbook is in same location.
> >>> >
> >>> > Thanks
> >>> > Rahul
> >>> >
> >>> > --
> >>> > 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 ansible-project+unsubscr...@googlegroups.com.
> >>> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com
> .
> >>>
> >>>
> >>>
> >>> --
> >>> Dick Visser
> >>> Trust & Identity Service Operations Manager
> >>> GÉANT
> >>>
> >>> --
> >>> 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 ansible-project+unsubscr...@googlegroups.com.
> >>> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com
> .
> >
> > --
> > 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 ansible-project+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rExkcQeBUrPBkn2C4dy3sgP3mD6eBYBAL2dWLG69NxySaA%40mail.gmail.com
> .
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMv6ssuLaAqXnPKZMY836rF-Ep59W8WExA41-yObHka8Q%40mail.gmail.com
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEweyyqF0g4Fhzd%3DrferaTp2H7zhj5%3Dhxa4K9HWYKTf8nA%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Dick Visser
Actually, it's this:

cloud: "{{ clouds.mycloud }}"

On Thu, 1 Aug 2019 at 10:03, Rahul Kumar  wrote:
>
> sorry to come back Dick. It is still not working from clouds.yaml
>  "msg": "The task includes an option with an undefined variable. The error 
> was: 'mycloud' is undefined\n\nThe error appears to be in 
> '/root/tas/simpledemo/Main-Playbook.yaml': line 5, column 7, but may\nbe 
> elsewhere in the file depending on the exact syntax problem.\n\nThe offending 
> line appears to be:\n\n  tasks:\n- name: create network\n  ^ here\n"
> Though i defined: cloud: "{{ mycloud }}"
>
> On Wed, 31 Jul 2019 at 15:34, Rahul Kumar  wrote:
>>
>> Thanks Dick. It worked, I forgot this by mistake.
>>
>> On Wed, 31 Jul 2019 at 14:56, Dick Visser  wrote:
>>>
>>> You are using the literal string 'cloud'.
>>> Change that entry in the os_network task to:
>>>
>>>  cloud: "{{ mycloud }}"
>>>
>>> On Wed, 31 Jul 2019 at 09:37, Rahul Kumar  wrote:
>>> >
>>> > Hi All,
>>> > I am trying to create Openstack instances using Ansible for Openstack.
>>> > I have clouds.yaml as below:
>>> > clouds:
>>> >   mycloud:
>>> > auth:
>>> >   auth_url: https://:/v3
>>> >   project_name: mycloud
>>> >   username: mycloud
>>> >   project_domain_name: Default
>>> >   user_domain_name: Default
>>> >   password: mycloudpwd
>>> > region_name: regionOne
>>> > interface: public
>>> > identity_api_version:
>>> > and Main Playbook is as below:
>>> > ---
>>> > - name: Create a test environment
>>> >   hosts: localhost
>>> >   tasks:
>>> > - name: create network
>>> >   os_network:
>>> > cloud: mycloud
>>> > state: present
>>> > name: test-network
>>> > external: false
>>> > wait: yes
>>> > -
>>> > --
>>> > But i am resulting in error:
>>> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud 
>>> > was not found."}.
>>> > Notice clouds.yaml and Main Playbook is in same location.
>>> >
>>> > Thanks
>>> > Rahul
>>> >
>>> > --
>>> > 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 ansible-project+unsubscr...@googlegroups.com.
>>> > To view this discussion on the web visit 
>>> > https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com.
>>>
>>>
>>>
>>> --
>>> Dick Visser
>>> Trust & Identity Service Operations Manager
>>> GÉANT
>>>
>>> --
>>> 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 ansible-project+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAGH8rExkcQeBUrPBkn2C4dy3sgP3mD6eBYBAL2dWLG69NxySaA%40mail.gmail.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMv6ssuLaAqXnPKZMY836rF-Ep59W8WExA41-yObHka8Q%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Rahul Kumar
sorry to come back Dick. It is still not working from clouds.yaml
 "msg": "The task includes an option with an undefined variable. The error
was: 'mycloud' is undefined\n\nThe error appears to be in
'/root/tas/simpledemo/Main-Playbook.yaml': line 5, column 7, but may\nbe
elsewhere in the file depending on the exact syntax problem.\n\nThe
offending line appears to be:\n\n  tasks:\n- name: create network\n
 ^ here\n"
Though i defined: cloud: "{{ mycloud }}"

On Wed, 31 Jul 2019 at 15:34, Rahul Kumar  wrote:

> Thanks Dick. It worked, I forgot this by mistake.
>
> On Wed, 31 Jul 2019 at 14:56, Dick Visser  wrote:
>
>> You are using the literal string 'cloud'.
>> Change that entry in the os_network task to:
>>
>>  cloud: "{{ mycloud }}"
>>
>> On Wed, 31 Jul 2019 at 09:37, Rahul Kumar  wrote:
>> >
>> > Hi All,
>> > I am trying to create Openstack instances using Ansible for Openstack.
>> > I have clouds.yaml as below:
>> > clouds:
>> >   mycloud:
>> > auth:
>> >   auth_url: https://:/v3
>> >   project_name: mycloud
>> >   username: mycloud
>> >   project_domain_name: Default
>> >   user_domain_name: Default
>> >   password: mycloudpwd
>> > region_name: regionOne
>> > interface: public
>> > identity_api_version:
>> > and Main Playbook is as below:
>> > ---
>> > - name: Create a test environment
>> >   hosts: localhost
>> >   tasks:
>> > - name: create network
>> >   os_network:
>> > cloud: mycloud
>> > state: present
>> > name: test-network
>> > external: false
>> > wait: yes
>> > -
>> > --
>> > But i am resulting in error:
>> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud
>> was not found."}.
>> > Notice clouds.yaml and Main Playbook is in same location.
>> >
>> > Thanks
>> > Rahul
>> >
>> > --
>> > 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 ansible-project+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com
>> .
>>
>>
>>
>> --
>> Dick Visser
>> Trust & Identity Service Operations Manager
>> GÉANT
>>
>> --
>> 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 ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com
>> .
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rExkcQeBUrPBkn2C4dy3sgP3mD6eBYBAL2dWLG69NxySaA%40mail.gmail.com.


[ansible-project] Ansible for Openstack

2019-07-31 Thread Rahul Kumar
Hi All,
I am trying to create complete stack of Openstack as below snippet:
  os_server:
 name: "{{ prefix }}-{{ item.name }}"
 state: present
 key_name: "{{ item.key }}"
 availability_zone: "{{ item.availability_zone }}"
 nics: "{{ item.nics }}"
 image: "{{ item.image }}"
 flavor: "{{ item.flavor }}"
  with_items: "{{ servers }}"
  register: "os_hosts"

- name: Create Networks
  os_network:
name: "{{ item.name }}"
state: present
external: false
wait: yes
  with_items: "{{ networks }}"

I am trying to understand , how I can make dependencies of one task to
another. For example in above example:
If network does not exist (with the specfified ID item.nics ), then create
the one using 2nd task ? And since its mutlinetworks and multiserver mode,
how we ensure that particular server is attached to particular network,
does this needs to be taken care while defining those variables or anything
else in playbook we can do?

Rahul

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rExjk5DbAQE_MDxoJckih1_6kCirNDfO%2BG9U4W3hdBUvJA%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-07-31 Thread Rahul Kumar
Thanks Dick. It worked, I forgot this by mistake.

On Wed, 31 Jul 2019 at 14:56, Dick Visser  wrote:

> You are using the literal string 'cloud'.
> Change that entry in the os_network task to:
>
>  cloud: "{{ mycloud }}"
>
> On Wed, 31 Jul 2019 at 09:37, Rahul Kumar  wrote:
> >
> > Hi All,
> > I am trying to create Openstack instances using Ansible for Openstack.
> > I have clouds.yaml as below:
> > clouds:
> >   mycloud:
> > auth:
> >   auth_url: https://:/v3
> >   project_name: mycloud
> >   username: mycloud
> >   project_domain_name: Default
> >   user_domain_name: Default
> >   password: mycloudpwd
> > region_name: regionOne
> > interface: public
> > identity_api_version:
> > and Main Playbook is as below:
> > ---
> > - name: Create a test environment
> >   hosts: localhost
> >   tasks:
> > - name: create network
> >   os_network:
> > cloud: mycloud
> > state: present
> > name: test-network
> > external: false
> > wait: yes
> > -
> > --
> > But i am resulting in error:
> > fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud
> was not found."}.
> > Notice clouds.yaml and Main Playbook is in same location.
> >
> > Thanks
> > Rahul
> >
> > --
> > 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 ansible-project+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com
> .
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rExOgqSyWF25fy0xRxgH0xMhToMNhUZ42a%2BZfe44nBN90g%40mail.gmail.com.


Re: [ansible-project] Ansible For Openstack

2019-07-31 Thread Dick Visser
You are using the literal string 'cloud'.
Change that entry in the os_network task to:

 cloud: "{{ mycloud }}"

On Wed, 31 Jul 2019 at 09:37, Rahul Kumar  wrote:
>
> Hi All,
> I am trying to create Openstack instances using Ansible for Openstack.
> I have clouds.yaml as below:
> clouds:
>   mycloud:
> auth:
>   auth_url: https://:/v3
>   project_name: mycloud
>   username: mycloud
>   project_domain_name: Default
>   user_domain_name: Default
>   password: mycloudpwd
> region_name: regionOne
> interface: public
> identity_api_version:
> and Main Playbook is as below:
> ---
> - name: Create a test environment
>   hosts: localhost
>   tasks:
> - name: create network
>   os_network:
> cloud: mycloud
> state: present
> name: test-network
> external: false
> wait: yes
> -
> --
> But i am resulting in error:
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud was 
> not found."}.
> Notice clouds.yaml and Main Playbook is in same location.
>
> Thanks
> Rahul
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com.


[ansible-project] Ansible For Openstack

2019-07-31 Thread Rahul Kumar
Hi All,
I am trying to create Openstack instances using Ansible for Openstack.
I have clouds.yaml as below:
clouds:
  mycloud:
auth:
  auth_url: https://:/v3
  project_name: mycloud
  username: mycloud
  project_domain_name: Default
  user_domain_name: Default
  password: mycloudpwd
region_name: regionOne
interface: public
identity_api_version:
and Main Playbook is as below:
---
- name: Create a test environment
  hosts: localhost
  tasks:
- name: create network
  os_network:
cloud: mycloud
state: present
name: test-network
external: false
wait: yes
-
--
But i am resulting in error:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud was
not found."}.
Notice clouds.yaml and Main Playbook is in same location.

Thanks
Rahul

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com.


Re: [ansible-project] Ansible for Openstack

2019-07-30 Thread Dick Visser
Use a loop to repeat the task as many times as you need

On Tue, 30 Jul 2019 at 10:26, Rahul Kumar  wrote:

> Hi Team,
> Currently I am trying to provision Openstack resources using Ansible with
> sample template snippet as below:
>  os_server:
> state: present
> cloud: smscrhosp
> name: test-instance
> image: CentOS-7-x86_64-GenericCloud
> key_name: mariachi-pub-key
> timeout: 200
> flavor: m1.small
> network: test-network
> auto_ip: yes
> security_groups:
>
> I want to know , if our topology needs 10 nodes , then do we need to write
> this os_server 10 times in Playbook
> or is there any better way to achive same?
>
> Rahul
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzWEkhCMvnM8E2DMv9m3oYJ-tPVTVdJR9HWCQ%2BsdFkeXw%40mail.gmail.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwOWhttyuWymErJNqqoeq7D55K5Ni1VscG%3D%3D%2Ba4BYpuNrA%40mail.gmail.com.


[ansible-project] Ansible for Openstack

2019-07-30 Thread Rahul Kumar
Hi Team,
Currently I am trying to provision Openstack resources using Ansible with
sample template snippet as below:
 os_server:
state: present
cloud: smscrhosp
name: test-instance
image: CentOS-7-x86_64-GenericCloud
key_name: mariachi-pub-key
timeout: 200
flavor: m1.small
network: test-network
auto_ip: yes
security_groups:

I want to know , if our topology needs 10 nodes , then do we need to write
this os_server 10 times in Playbook
or is there any better way to achive same?
Rahul

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEzWEkhCMvnM8E2DMv9m3oYJ-tPVTVdJR9HWCQ%2BsdFkeXw%40mail.gmail.com.


[ansible-project] ansible for openstack hardening

2018-04-29 Thread fatim . boudguig
can you help me i have to write playbook for openstack hardening and i 
don't know wich modules i can use

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/75a6c689-2951-4d3b-9309-cf98fbbd969d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible for openstack

2016-04-13 Thread Matt Martz
I believe what you are looking for can be found at
https://github.com/openstack/openstack-ansible

On Wed, Apr 13, 2016 at 7:41 PM, ju  wrote:

> Hi,
>
> I want to run ansible to install openstack from a bare metal commodity
> hardware, has anyone known if there is already an ansible project exists
> for installing openstack? I found an announcement
> https://www.ansible.com/press/ansible-announces-the-simple-openstack-initiative,
> but could not find git source repository (I guess it has not been started
> yet??).
>
> Thank you.
>
> Kind regards,
>
> - ju
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8804a540-956e-4cb0-9134-a7c928cedb8e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v_zWOH0rV4zdAt%3Dg_ViC4mP7JsMS3C3T7iE2_gOEJXvaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible for openstack

2016-04-13 Thread ju
Hi,

I want to run ansible to install openstack from a bare metal commodity 
hardware, has anyone known if there is already an ansible project exists 
for installing openstack? I found an announcement 
https://www.ansible.com/press/ansible-announces-the-simple-openstack-initiative,
 
but could not find git source repository (I guess it has not been started 
yet??).

Thank you.

Kind regards,

- ju

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8804a540-956e-4cb0-9134-a7c928cedb8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.