Alexander Popov
2015-07-17 16:57:38 UTC
- name: crate vpc.
ec2_vpc:
...
register: vpc
- debug: var=vpc.vpc_id
- name: select public vpc
set_fact:
vpc_id: "{{vpc.vpc_id}}"
- debug: var=vpc_id
TASK [setup : setup : crate vpc]
************************************************
ok: [127.0.0.1] => {"changed": false, .... "vpc_id": "vpc-e31c0086"}
TASK [setup : setup : debug var=vpc.vpc_id]
*************************************
ok: [127.0.0.1] => {
"changed": false,
"vpc.vpc_id": "vpc-e31c0086"
}
TASK [setup : setup : select public vpc]
****************************************
ok: [127.0.0.1] => {"ansible_facts": {"vpc_id": "vpc-e31c0086"}, "changed":
false}
TASK [setup : setup : debug var=vpc_id]
*****************************************
ok: [127.0.0.1] => {
"changed": false,
"vpc_id": "VARIABLE IS NOT DEFINED!"
}
what i'm doing wrong?
ec2_vpc:
...
register: vpc
- debug: var=vpc.vpc_id
- name: select public vpc
set_fact:
vpc_id: "{{vpc.vpc_id}}"
- debug: var=vpc_id
TASK [setup : setup : crate vpc]
************************************************
ok: [127.0.0.1] => {"changed": false, .... "vpc_id": "vpc-e31c0086"}
TASK [setup : setup : debug var=vpc.vpc_id]
*************************************
ok: [127.0.0.1] => {
"changed": false,
"vpc.vpc_id": "vpc-e31c0086"
}
TASK [setup : setup : select public vpc]
****************************************
ok: [127.0.0.1] => {"ansible_facts": {"vpc_id": "vpc-e31c0086"}, "changed":
false}
TASK [setup : setup : debug var=vpc_id]
*****************************************
ok: [127.0.0.1] => {
"changed": false,
"vpc_id": "VARIABLE IS NOT DEFINED!"
}
what i'm doing wrong?
--
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+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/814bd7e8-38ce-4230-a71f-caaa761e341c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/814bd7e8-38ce-4230-a71f-caaa761e341c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.