[ansible-project] How to filter plugins access vars from host

2020-10-21 Thread Rafael Tomelin
Hi,

I create a new filter plugin but the plugin needs to get vars from the
host.  How to get the vars in python filter plugins?

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbCfxUNeisKqmZ1PmrpRLzYLnOqNvZ9gx9XUwJZu%3Dm8Lnw%40mail.gmail.com.


[ansible-project] How treat errors in tasks

2020-10-13 Thread Rafael Tomelin
Hi,

I have the function that creates a database and after creating the DB I
inserted the access information in a VAULT, the problem that sometimes
inconsistent information is passed and the database creation TASK returns
an error.

I would like to know if when I have an error before canceling the execution
I call another task or via callback call a previous task?

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbA7tXzpHvT%2B4T6rRAYN%2BW6XV_yReW3rE-mUf_KU6wnNJw%40mail.gmail.com.


[ansible-project] Using the filter_plugins in conditional when

2020-09-02 Thread Rafael Tomelin
Hi dear,

I created the filter_plugin that check if running process and return true
or false. This is an example:

process_name|get_processes

I want to create this task:

*- name: start service*
*  shell: /usr/local/bin/my_script*
*  when: process_name|get_processes is false*

But it seems to me that the conditional does not accept filter_plugin.

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbDLJ%2BqXtCOvrPELFQA9OeoSG7Q-p7kZbAdW0yvVRuftKw%40mail.gmail.com.


[ansible-project] Filter in dynamic inventory

2020-07-24 Thread Rafael Tomelin
Hi guys,

I use dynamic inventory azure_rm and I have a problem with
exluce_host_filters.

Some vms starts with xyz... and has tags.  I need to filter the VMs starts
with xyz but not has tags firewall and not working.

exclude_host_filters:
- location not in ['eastus2']
- "'xyz' not in name"
- "'firewall' in tags.product"


Other question,
Is possible create inventory children in dynamic inventory, example?
conditional_groups:
vms:
- dev: "name.startswith('xyz_dev')"
- win: "'windows' in os_disk.operating_system_type"
- lnx: os_disk.operating_system_type == 'linux'



-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbBjCWX36hag8rsu9YcvyLeMdH64jGhmmA6aDMwrh7LO3w%40mail.gmail.com.


Re: [ansible-project] Reboot servers strategy.

2020-07-01 Thread Rafael Tomelin
Hi,

I get all servers from Azure and created inventory in memory by ansible.
After get server and created inventory, connect in all servers collection
facts and execute update of servers.  This moment I need to create a
process to reboot my servers by custom facts.


On Tue, Jun 30, 2020 at 4:53 PM John Petro  wrote:

> Are you using ansible to apply updates and reboot now?  If so, what does
> your current process look like?
>
> --john
>
> On Mon, Jun 29, 2020 at 3:26 PM Rafael Tomelin 
> wrote:
>
>>
>> Hi Guys,
>> I have periodic updates on all RedHat servers at the same time, I need to
>> create a strategy to restart my clusters because I can't stop my
>> application and services.
>>
>> How to create the reboot strategy server-per-server in clusters?
>>
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-984104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>> Red Hat Certified Engineer
>> Puppet Professional 2017 Certification
>>
>> --
>> 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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAPAjob-WzDS9BXVnGCvhS%3DXS%2B179f7mf-nJEbMQA-5-4_kZtmA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbCehhAhS6c-H40Dx5bPLfX5mJEF9Zkc%2BdocnpKnpYB8SQ%40mail.gmail.com.


[ansible-project] Reboot servers strategy.

2020-06-29 Thread Rafael Tomelin
Hi Guys,
I have periodic updates on all RedHat servers at the same time, I need to
create a strategy to restart my clusters because I can't stop my
application and services.

How to create the reboot strategy server-per-server in clusters?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAwBVcpuWsULocMZ2ts4-298wqjmkkEvhRhRSDaFdnHPQ%40mail.gmail.com.


Re: [ansible-project] Needs to Write a Playbook

2020-06-17 Thread Rafael Tomelin
Hi Rama,

You can create playbook/role simples:

1) create regex and split server from number "{{
ansible_hostname.split('server')[1]  }}"
2) Check if the number is divisor per 2;  {{ variable_number % 2 }}
3) if divisor 2, copy script1 else copy script 2  file:  src: script{{
var01 }}

On Mon, Jun 15, 2020 at 3:26 AM rama543  wrote:

> Hi Friends,
>
> I am new to this Ansible world
>
> Needs to write a playbook for one scenario
>
> Scenario-1:
>
> I have 1000 Servers . Host-names are like   Server1, Server2, Server3,
> Server4, Server5, .Server1000 .
>
> I have two Script files   Script-1.sh  and Script-2.sh  in my controller .
>
> Now i want create a folder  "/opt/Server/Odd" and copy the Script-1.sh
> file  in Server1, Server3, Server5, Server7 ..Server999 .
> create a folder  "/opt/Server/Even" and copy the Script-2.sh file  in
> Server2, Server4, Server6, Server8, .Server1000.
>
> Can you guys help me to write playbook
>
> Thanks in Advance
>
> --
> 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/682613d9-09c4-4aa6-b52e-338a076c51e2o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/682613d9-09c4-4aa6-b52e-338a076c51e2o%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbDzoBg%2BUjORXQtaeVk4m0ZEYHNWiuPz-Sms%2B0TrRpeNzw%40mail.gmail.com.


Re: [ansible-project] Re: Windows Domain/Ansible Kerberos Auth Issues Still

2020-06-16 Thread Rafael Tomelin
Hi Dave,

I didn't understand the problem, but I would to like help you.

My wait server is:
- name: waiting Windows server
wait_for:
port: 5985
sleep: 50
timeout: 500
host: "{{ groups[item[1]][-1] }}"
when:
- item[0].value.os_type | lower == 'windows'
- item[0].key == item[1]
loop_control:
index_var: idx
with_nested:
- "{{ virtual_machine|dict2items }}"
- "{{ groups }}"

- name: waiting linux server
wait_for:
port: 22
sleep: 10
timeout: 300
host: "{{ groups[item[1]][-1] }}"
when:
- item[0].value.os_type | lower == 'linux'
- item[0].key == item[1]
loop_control:
index_var: idx
with_nested:
- "{{ virtual_machine|dict2items }}"
- "{{ groups }}"


About your problem authentication, in Kerberos/sssd is possibly defined the
default domain if you working more domains but you need pass user+domain
for authentication.

On Mon, Jun 15, 2020 at 5:00 PM Dave York  wrote:

> The machines being managed here are windows machines - but the ansible
> tower server itself is linux (obviously) - I wonder if the kerberos
> configuration on the tower machine may be running into a flavor of what
> you're suggesting - but im not sure exactly how I would point the tower
> server directly to just one DC for authentication
>
> On Thursday, June 11, 2020 at 4:01:46 AM UTC-7, David Foley wrote:
>>
>> Are these Linux Machines?
>> how many Domain Controllers are in your Environment if you have more then
>> one it may be doing a round-robin on the Kerberos and failing on one Domain
>> and not on the other.: you need to start restricting down to only allow
>> your Linux Server to Connect to one AD.
>>
>> --
> 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/01aa821e-afb8-45fb-8bd0-3baec466e97co%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/01aa821e-afb8-45fb-8bd0-3baec466e97co%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbD7Pb2skVqpU_79oOxdXeopcRbOEOeUUgouZQFnN-JdGw%40mail.gmail.com.


Re: [ansible-project] Conditional with dict2item is falied

2020-06-15 Thread Rafael Tomelin
OK, thanks!

On Mon, Jun 15, 2020 at 4:42 PM Matt Martz  wrote:

> In the case of using `when` and `loop`, the `when` statements is applied
> to each iteration of the `loop`, and not before it.
>
> As such, you cannot prevent a loop from happening using a when statement.
>
> Instead you want to do this in loop, like:
>
> loop: '{{ virtual_machine|default({})|dict2items }}'
>
> On Mon, Jun 15, 2020 at 2:39 PM Rafael Tomelin 
> wrote:
>
>>
>> Hi guys,
>>
>> I have a task with equal below, but when I validate it is defined it not
>> recognized.
>> - name: include vars virtual_machine
>> include_tasks: virtual_machine.yml
>> when:
>> - gms_az_vm_action == 'create_virtual_machine'
>> - virtual_machine is defined
>> loop: "{{ virtual_machine|dict2items }}"
>>
>>
>>
>> How I do for doesn't read loop and not stop playbook when virtual_machine
>> not defined?
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-984104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>> Red Hat Certified Engineer
>> Puppet Professional 2017 Certification
>>
>> --
>> 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/CAGEUqbAv4tEJoSWWU7TR9YP3x%2B5BzVDO6NmS7rZCGYhEHN_ocg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbAv4tEJoSWWU7TR9YP3x%2B5BzVDO6NmS7rZCGYhEHN_ocg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAD8N0v_A15vdx3waWE%3DH5ztveN-W6MdNz%2BP_WGAFOpEbRsFprg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v_A15vdx3waWE%3DH5ztveN-W6MdNz%2BP_WGAFOpEbRsFprg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbBzqwaSMEGZ3wEbi7wjTVqCWeqBfkM61PnjNJd6M-eLfA%40mail.gmail.com.


[ansible-project] Conditional with dict2item is falied

2020-06-15 Thread Rafael Tomelin
Hi guys,

I have a task with equal below, but when I validate it is defined it not
recognized.
- name: include vars virtual_machine
include_tasks: virtual_machine.yml
when:
- gms_az_vm_action == 'create_virtual_machine'
- virtual_machine is defined
loop: "{{ virtual_machine|dict2items }}"



How I do for doesn't read loop and not stop playbook when virtual_machine
not defined?

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAv4tEJoSWWU7TR9YP3x%2B5BzVDO6NmS7rZCGYhEHN_ocg%40mail.gmail.com.


[ansible-project] How use with_sequence and with_dict together

2019-12-18 Thread Rafael Tomelin
Hi,

I want to do loop in the dict variable appliance and in variable have var
count.  This count I should like loop count.

appliances:
  fw01:
count: 2
vmname: name
image: redhat
os_type: Linux
data_disks:
  - lun: 0
disk_size_gb: 128
managed_disk_type: Standard_LRS

I create this task debug for tests:

- name: virtual_machine
  debug:
msg: "{{ item.key }} - {{ item.value.count }}"
  with_dict:
- "{{ virtual_machine }}"
  with_sequence: start=0 end="{{ item.value.count }}"

but return this error:
ERROR! duplicate loop in task: sequence



How can create this loop?

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbBJAcUKQRJqWpY0GEJqZqcynM6VwpnG64QNGQS-%3DyjccA%40mail.gmail.com.


[ansible-project] with_dict in loop counter

2019-12-18 Thread Rafael Tomelin
Hi,

I have a task for creating the virtual machine at Azure with_dict.

I should like to create a variable count (number the VMS) and put it
with_dict.

How can create loop count with with_dict?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbBao7gxPbcJAr7Hb8%3DBSpb5gwHY8WnadLLPTuWZfrpc%2Bw%40mail.gmail.com.


[ansible-project] Create custom plugin for running in ansible server

2019-12-11 Thread Rafael Tomelin
Hey Dear,

I would like to know if exists plugin, filter, module, then always running 
in ansible server, not necessary to specify delegate_to or 
local_action.  If exists, which is and how work?

-- 
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/942cd73a-d6d3-4fed-918e-7c90c1166e58%40googlegroups.com.


Re: [ansible-project] Loop with hostvars groups

2019-08-27 Thread Rafael Tomelin
Hi Vinoth,

Thanks, your recommendation is work.

On Tue, Aug 27, 2019 at 9:10 AM vinoth kumar  wrote:

> Hi
> remove hostvars[host].ansible_hostname and try with
> hostvars[host].ansible_facts.hostname if you are doing it from setup module
> or gayher_facts
>
> If it’s not fixed put your playbook here
>
> On Tue, 27 Aug 2019 at 5:36 PM, Rafael Tomelin 
> wrote:
>
>>
>> Hi,
>>
>> I have an inventory with groups this configuration the DB Servers:
>>
>> [db]
>> 192.168.0.1
>> 192.168.0.2
>> 192.168.0.3
>>
>> I want to do loop the groups and get variable ipaddress in template.j2.
>> My loop is:
>> {% for host in groups['db'] -%}
>> hostall postgres   {{ hostvars[host].ansible_hostname
>> }}/32   trust
>> {% endfor %}
>>
>> My error
>>
>> "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars
>> object' has no attribute 'ansible_hostname'",
>>
>> What`s correct configuration?
>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-984104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>> Red Hat Certified Engineer
>> Puppet Professional 2017 Certification
>>
>> --
>> 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/CAGEUqbCW9GZVwGQ%2BtqQopQBpOAEV-c7_08ud0TWu-AawmEDiRA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbCW9GZVwGQ%2BtqQopQBpOAEV-c7_08ud0TWu-AawmEDiRA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAJ%2BRxtRneB6nrP680LhkiQ9WRBJ-r3KDo1u9EVFkzE8MUsbapQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAJ%2BRxtRneB6nrP680LhkiQ9WRBJ-r3KDo1u9EVFkzE8MUsbapQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAP4MQ8Gi7-GDhwLsYTZ08EbQu08N-7_m2BjHA22LF3Ow%40mail.gmail.com.


[ansible-project] Loop with hostvars groups

2019-08-27 Thread Rafael Tomelin
Hi,

I have an inventory with groups this configuration the DB Servers:

[db]
192.168.0.1
192.168.0.2
192.168.0.3

I want to do loop the groups and get variable ipaddress in template.j2. My
loop is:
{% for host in groups['db'] -%}
hostall postgres   {{ hostvars[host].ansible_hostname
}}/32   trust
{% endfor %}

My error

"msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars
object' has no attribute 'ansible_hostname'",

What`s correct configuration?



-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbCW9GZVwGQ%2BtqQopQBpOAEV-c7_08ud0TWu-AawmEDiRA%40mail.gmail.com.


[ansible-project] Create module ansible

2019-07-04 Thread Rafael Tomelin
Hi guys,

I maned be creating ansible module for generating name my resources a
cloud, but need before defined fields know this type of resource.
I wanna valid field type before declared other fields.

Ex.:
fields = {"type": {"required": False, "type": "str"}}
module = AnsibleModule(argument_spec=fields)

if module.params['type'] == 'vm':
fields = {
"entity": {"required": False, "type": "str"},
"region": {"required": False, "type": "str"},
"product": {"default": False, "type": "str" },
"environment": {"default": False, "type": "str" },
"resource": {"required": False, "type": "str" },
"os": {"default": False, "type": "str" },
"type": {"required": True, "type": "str"},
}
else:
fields = {
"entity": {"required": True, "type": "str"},
"region": {"required": True, "type": "str"},
"product": {"default": True, "type": "str" },
"environment": {"default": True, "type": "str" },
"purpose": {"default": True, "type": "str" },
"resource": {"required": True, "type": "str" },
"acronym": {"default": True, "type": "str" },
"type": {"required": True, "type": "str"},
}

module = AnsibleModule(argument_spec=fields)
 ..


but return error msg: 'Unsupported parameters for (generate_name) module:
entity, environment, os, product, region, resource Supported parameters
include: type'

How can valid type value?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbCZ38w-UGOPDopdxb4v4v1kaaoEK7AP8aDT6wWzMaoxPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Used variable groups and users in iventory

2019-07-01 Thread Rafael Tomelin
OK,

But this problem is equaled in AWX management ansible.

On Mon, Jul 1, 2019 at 3:22 PM Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:

> On 01.07.2019 20:12, Rafael Tomelin wrote:
> > Dears,
> >
> > I am using Ansible Tower for management ansible.   I am with a problem
> > because put variables (groups and hosts) in inventory but not load in
> jobs.
>
> This is the list for Ansible and not Tower.
>
> Contact RedHat support for help with Tower.
>
>
> --
> Kai Stian Olstad
>
> --
> 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/a5f9e2f9-d3dd-6366-940e-f76b4447bbc0%40olstad.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAekFrcYSH1jB69OhDkwGTPnuW3no8d9HHbhkQA%2Byd4-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Used variable groups and users in iventory

2019-07-01 Thread Rafael Tomelin
Dears,

I am using Ansible Tower for management ansible.   I am with a problem
because put variables (groups and hosts) in inventory but not load in jobs.


How can loaded variables in groups and hosts from inventory?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbBt6%2BMWQpT7rkvAKZj61fB%2B1ZN3F8XYaPTS-zWfSNo6Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Role requiments other roles

2019-05-17 Thread Rafael Tomelin
Hi,

I create new role for deploy services in cloud.  My role requirement
role azure.azure_preview_modules, but can`t execute.

Not possible configuration with dependencies but execution role.

How is create requirement in role other role?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

-- 
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/CAGEUqbAqTLUWPbFJ3_gzRPg6ddL5rbNdOV8haADMa21i8Z-RGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Create custom facts in windows

2019-04-09 Thread Rafael Tomelin
Hi,

I need create custom facts in windows, but where directory create in 
windows for customs facts?  How set path custom facts in windows in ansible?

-- 
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/294a9c9f-7bc7-46c9-970f-77fe87923f48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible tower export variable

2019-03-29 Thread Rafael Tomelin
Hi,

I need export variable the playbook for other playbook, this is possible?

I deploy virtual machine in Azure and after deploy my application.

Need deploy execute in 1 execution and not more deploys


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbBmxx0t%3DH%3DY_X82UnJtxkvfXQLUH%3DcYkPHaNchLg7%2Be_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Generate resgiter from dict var

2019-02-06 Thread Rafael Tomelin
Hi ,

I need create register from variable.

My variable is:
my_rules:
  - name: 'AllowSSH'
protocol: Tcp
destination_port_range: 22
access: Allow
priority: 100
direction: Inbound
  - name: 'AllowHTTPS'
protocol: Tcp
destination_port_range: 443
access: Allow
priority: 90
direction: Inbound

I need, put the content in variable.

Is need to security_group in azure or aws.


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbCMM5%3DD%2BduS372k4m%3DkC%2BLsqwutS1N-%3DLT6Lgj0%3D6Z4%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Defined variable when value different

2019-02-04 Thread Rafael Tomelin
Thanks, resolved.



On Mon, Feb 4, 2019 at 11:07 AM Keif Gwinn  wrote:

> - name: Create Additional network interface
> azure_rm_networkinterface:
> name: "interface{{item}}"
> resource_group: my_resource
> virtual_network_name: my_virtual_network_name
> subnet_name: my_subnet
> ip_configurations:
> - name: ipconfig{{item}}
> public_ip_address_name: "{{ get_ip_public.state.name }}"
> primary: False
> with_sequence: start=1 end=networkinterface_numberminus1
> vars:
> networkinterface_numberminus1: networkinterface_number - 1
>
>
> On Mon, 4 Feb 2019 at 12:36, Rafael Tomelin 
> wrote:
>
>> Ok, the first interface TRUE and 0> is false.
>>
>> How to   with_sequence: start=1 end=*"networkinterface_number - 1"*
>>
>> On Mon, Feb 4, 2019 at 10:22 AM Keif Gwinn  wrote:
>>
>>> - name: Create Primary network interface
>>> azure_rm_networkinterface:
>>> name: "interface{{item}}"
>>> resource_group: my_resource
>>> virtual_network_name: my_virtual_network_name
>>> subnet_name: my_subnet
>>> ip_configurations:
>>> - name: ipconfig{{item}}
>>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>>> primary: True
>>> with_sequence: start=0 end=0
>>>
>>> - name: Create Additional network interface
>>> azure_rm_networkinterface:
>>> name: "interface{{item}}"
>>> resource_group: my_resource
>>> virtual_network_name: my_virtual_network_name
>>> subnet_name: my_subnet
>>> ip_configurations:
>>> - name: ipconfig{{item}}
>>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>>> primary: False
>>> with_sequence: start=1 end=networkinterface_number
>>>
>>>
>>> Would be my suggestion, it looks like it'd need some work around the IP
>>> address assignments.
>>>
>>> On Mon, 4 Feb 2019 at 12:10, Rafael Tomelin 
>>> wrote:
>>>
>>>> Hi Keif,
>>>>
>>>> I need this example:
>>>>
>>>> ---
>>>> - hosts: localhost
>>>>   vars:
>>>> networkinterface_number: 5
>>>>
>>>>   tasks:
>>>>   - debug: "msg='network {{ myvar }} '"
>>>> vars:
>>>>   myvar: "{{ 'True' if ( item == 1) else 'False' }}"
>>>> with_sequence: count="{{networkinterface_number}}"
>>>>
>>>> But, myvar not replace in loop with_sequence.
>>>>
>>>>
>>>>
>>>> On Mon, Feb 4, 2019 at 8:55 AM Keif Gwinn 
>>>> wrote:
>>>>
>>>>> multiple blocks with the when: keyword?
>>>>>
>>>>> On Fri, 1 Feb 2019 at 19:37, Rafael Tomelin 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> How defined variable value when other variable for different the 1.
>>>>>>
>>>>>> Exemplo
>>>>>>
>>>>>> vars:
>>>>>>   networkinterface_number: 1
>>>>>>
>>>>>> - name: Create network interface
>>>>>>   azure_rm_networkinterface:
>>>>>> name: "interface{{networkinterface_number}}"
>>>>>> resource_group: my_resource
>>>>>> virtual_network_name: my_virtual_network_name
>>>>>> subnet_name: my_subnet
>>>>>> ip_configurations:
>>>>>>   - name: ipconfig1
>>>>>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>>>>>> primary: True * # if "{{networkinterface_number}}" for equal
>>>>>> 1 primary True else False*
>>>>>>   with_sequence: count=3 #"{{networkinterface_number}}"
>>>>>>
>>>>>> --
>>>>>> Atenciosamente,
>>>>>>
>>>>>> Rafael Tomelin
>>>>>> Tel.: 51-84104084
>>>>>> Skype: rafael.tomelin
>>>>>>
>>>>>> LPI ID: LPI000191271
>>>>>>
>>>>>> --
>>>>>> 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 emai

Re: [ansible-project] Defined variable when value different

2019-02-04 Thread Rafael Tomelin
Ok, the first interface TRUE and 0> is false.

How to   with_sequence: start=1 end=*"networkinterface_number - 1"*

On Mon, Feb 4, 2019 at 10:22 AM Keif Gwinn  wrote:

> - name: Create Primary network interface
> azure_rm_networkinterface:
> name: "interface{{item}}"
> resource_group: my_resource
> virtual_network_name: my_virtual_network_name
> subnet_name: my_subnet
> ip_configurations:
> - name: ipconfig{{item}}
> public_ip_address_name: "{{ get_ip_public.state.name }}"
> primary: True
> with_sequence: start=0 end=0
>
> - name: Create Additional network interface
> azure_rm_networkinterface:
> name: "interface{{item}}"
> resource_group: my_resource
> virtual_network_name: my_virtual_network_name
> subnet_name: my_subnet
> ip_configurations:
> - name: ipconfig{{item}}
> public_ip_address_name: "{{ get_ip_public.state.name }}"
> primary: False
> with_sequence: start=1 end=networkinterface_number
>
>
> Would be my suggestion, it looks like it'd need some work around the IP
> address assignments.
>
> On Mon, 4 Feb 2019 at 12:10, Rafael Tomelin 
> wrote:
>
>> Hi Keif,
>>
>> I need this example:
>>
>> ---
>> - hosts: localhost
>>   vars:
>> networkinterface_number: 5
>>
>>   tasks:
>>   - debug: "msg='network {{ myvar }} '"
>> vars:
>>   myvar: "{{ 'True' if ( item == 1) else 'False' }}"
>> with_sequence: count="{{networkinterface_number}}"
>>
>> But, myvar not replace in loop with_sequence.
>>
>>
>>
>> On Mon, Feb 4, 2019 at 8:55 AM Keif Gwinn  wrote:
>>
>>> multiple blocks with the when: keyword?
>>>
>>> On Fri, 1 Feb 2019 at 19:37, Rafael Tomelin 
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> How defined variable value when other variable for different the 1.
>>>>
>>>> Exemplo
>>>>
>>>> vars:
>>>>   networkinterface_number: 1
>>>>
>>>> - name: Create network interface
>>>>   azure_rm_networkinterface:
>>>> name: "interface{{networkinterface_number}}"
>>>> resource_group: my_resource
>>>> virtual_network_name: my_virtual_network_name
>>>> subnet_name: my_subnet
>>>> ip_configurations:
>>>>   - name: ipconfig1
>>>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>>>> primary: True * # if "{{networkinterface_number}}" for equal 1
>>>> primary True else False*
>>>>   with_sequence: count=3 #"{{networkinterface_number}}"
>>>>
>>>> --
>>>> Atenciosamente,
>>>>
>>>> Rafael Tomelin
>>>> Tel.: 51-84104084
>>>> Skype: rafael.tomelin
>>>>
>>>> LPI ID: LPI000191271
>>>>
>>>> --
>>>> 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/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> --
>>> Keif Gwinn
>>>
>>> --
>>> 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/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>&g

Re: [ansible-project] Defined variable when value different

2019-02-04 Thread Rafael Tomelin
OK, but have 10 network?

This network interface number is dynamic.  The one interface is TRUE, more
ins FALSE

On Mon, Feb 4, 2019 at 10:22 AM Keif Gwinn  wrote:

> - name: Create Primary network interface
> azure_rm_networkinterface:
> name: "interface{{item}}"
> resource_group: my_resource
> virtual_network_name: my_virtual_network_name
> subnet_name: my_subnet
> ip_configurations:
> - name: ipconfig{{item}}
> public_ip_address_name: "{{ get_ip_public.state.name }}"
> primary: True
> with_sequence: start=0 end=0
>
> - name: Create Additional network interface
> azure_rm_networkinterface:
> name: "interface{{item}}"
> resource_group: my_resource
> virtual_network_name: my_virtual_network_name
> subnet_name: my_subnet
> ip_configurations:
> - name: ipconfig{{item}}
> public_ip_address_name: "{{ get_ip_public.state.name }}"
> primary: False
> with_sequence: start=1 end=networkinterface_number
>
>
> Would be my suggestion, it looks like it'd need some work around the IP
> address assignments.
>
> On Mon, 4 Feb 2019 at 12:10, Rafael Tomelin 
> wrote:
>
>> Hi Keif,
>>
>> I need this example:
>>
>> ---
>> - hosts: localhost
>>   vars:
>> networkinterface_number: 5
>>
>>   tasks:
>>   - debug: "msg='network {{ myvar }} '"
>> vars:
>>   myvar: "{{ 'True' if ( item == 1) else 'False' }}"
>> with_sequence: count="{{networkinterface_number}}"
>>
>> But, myvar not replace in loop with_sequence.
>>
>>
>>
>> On Mon, Feb 4, 2019 at 8:55 AM Keif Gwinn  wrote:
>>
>>> multiple blocks with the when: keyword?
>>>
>>> On Fri, 1 Feb 2019 at 19:37, Rafael Tomelin 
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> How defined variable value when other variable for different the 1.
>>>>
>>>> Exemplo
>>>>
>>>> vars:
>>>>   networkinterface_number: 1
>>>>
>>>> - name: Create network interface
>>>>   azure_rm_networkinterface:
>>>> name: "interface{{networkinterface_number}}"
>>>> resource_group: my_resource
>>>> virtual_network_name: my_virtual_network_name
>>>> subnet_name: my_subnet
>>>> ip_configurations:
>>>>   - name: ipconfig1
>>>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>>>> primary: True * # if "{{networkinterface_number}}" for equal 1
>>>> primary True else False*
>>>>   with_sequence: count=3 #"{{networkinterface_number}}"
>>>>
>>>> --
>>>> Atenciosamente,
>>>>
>>>> Rafael Tomelin
>>>> Tel.: 51-84104084
>>>> Skype: rafael.tomelin
>>>>
>>>> LPI ID: LPI000191271
>>>>
>>>> --
>>>> 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/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> --
>>> Keif Gwinn
>>>
>>> --
>>> 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/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more option

Re: [ansible-project] Defined variable when value different

2019-02-04 Thread Rafael Tomelin
Hi Keif,

I need this example:

---
- hosts: localhost
  vars:
networkinterface_number: 5

  tasks:
  - debug: "msg='network {{ myvar }} '"
vars:
  myvar: "{{ 'True' if ( item == 1) else 'False' }}"
with_sequence: count="{{networkinterface_number}}"

But, myvar not replace in loop with_sequence.



On Mon, Feb 4, 2019 at 8:55 AM Keif Gwinn  wrote:

> multiple blocks with the when: keyword?
>
> On Fri, 1 Feb 2019 at 19:37, Rafael Tomelin 
> wrote:
>
>> Hi,
>>
>> How defined variable value when other variable for different the 1.
>>
>> Exemplo
>>
>> vars:
>>   networkinterface_number: 1
>>
>> - name: Create network interface
>>   azure_rm_networkinterface:
>> name: "interface{{networkinterface_number}}"
>> resource_group: my_resource
>> virtual_network_name: my_virtual_network_name
>> subnet_name: my_subnet
>> ip_configurations:
>>   - name: ipconfig1
>> public_ip_address_name: "{{ get_ip_public.state.name }}"
>> primary: True * # if "{{networkinterface_number}}" for equal 1
>> primary True else False*
>>   with_sequence: count=3 #"{{networkinterface_number}}"
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-84104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>>
>> --
>> 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/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Keif Gwinn
>
> --
> 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/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAMTXzjXJK5V%2BvtN%3DKJf1j6AssCtCj2Q1f-%3DSxj%2Bk1paYg058JA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbBeG%3D--NQkpm07Qcq8RPozLPX9mh5z-4hT1m9j9CXKTTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Defined variable when value different

2019-02-01 Thread Rafael Tomelin
Hi,

How defined variable value when other variable for different the 1.

Exemplo

vars:
  networkinterface_number: 1

- name: Create network interface
  azure_rm_networkinterface:
name: "interface{{networkinterface_number}}"
resource_group: my_resource
virtual_network_name: my_virtual_network_name
subnet_name: my_subnet
ip_configurations:
  - name: ipconfig1
public_ip_address_name: "{{ get_ip_public.state.name }}"
primary: True * # if "{{networkinterface_number}}" for equal 1
primary True else False*
  with_sequence: count=3 #"{{networkinterface_number}}"

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbCOC35%3DisWmP65ZJ9kMpjgXNVJSV5uLCmS2RocVr00cqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Callback with grafana

2019-01-30 Thread Rafael Tomelin
I configuration replace 'grafana_url = http://grafana.mydomain.com:3000' to
'grafana_url = http://grafana.mydomain.com:3000/API/annotations' and not
report error '[ERROR]: Could not send message to Grafana: HTTP Error 404:
not found'.

But, not send data to grafana.

Em qua, 30 de jan de 2019 23:36, Rafael Tomelin 
escreveu:

> Hello guys,
>
> I'm trying to set up callback not available from the '
> https://blog.octo.com/en/walkthrough-watch-your-ansible-deployments-in-grafana/'
> link, but it is not working and displays the following message:
>
> [DEPRECATION WARNING]: callback grafana_annotations, does not support
> configuration of 'options', will work for now, but this will be necessary
> in the future and should be updated,
> see the 2.4 portability guide for details. This feature will be removed in
> version 2.9. Discontinuance warnings can be disabled by setting
> deprecation_warnings = False in ansible.cfg.
> [ERROR]: Could not send message to Grafana: HTTP Error 404: not found
>
> My configuration is as follows /etc/ansible/ansible.cfg:
> [standards]
> roles_path = / etc / ansible / roles
> host_key_checking = False
> stdout_callback = yaml
> callback_whitelist = grafana_annotations
> log_path = /var/log/ansible.log
> [callback_grafana_annotations]
> grafana_url = http://grafana.mydomain.com:3000
> grafana_api_key = my_token
> validate_grafana_certs = False
> grafana_panel_id = 10
> callback_plugins = / etc / ansible / callback_plugins /
> bin_ansible_callbacks = True
>
> In the / etc / ansible / callback_plugins / directory, it has the
> following file:
> /etc/ansible/callback_plugins/grafana_annotations.py
>
>
> What may be the problem?
>
> --
>
> Atenciosamente,
>
> Rafael Tomelin
>
> skype: rafael.tomelin
>
> E-mail: rafael.tome...@gmail.com
>
> RHCE  - Red Hat Certified Engineer
> PPT-205 - Puppet Certified Professional 2017
> Zabbix- ZABBIX Certified Specialist
> LPI3
> ITIL v3
>
-- 

Atenciosamente,

Rafael Tomelin

skype: rafael.tomelin

E-mail: rafael.tome...@gmail.com

RHCE  - Red Hat Certified Engineer
PPT-205 - Puppet Certified Professional 2017
Zabbix- ZABBIX Certified Specialist
LPI3
ITIL v3

-- 
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/CAGEUqbBpeFBK_9YO2YDxkrpH6ipxXEZtA43RKfEXx%3DDeOoj0Hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Callback with grafana

2019-01-30 Thread Rafael Tomelin
Hello guys,

I'm trying to set up callback not available from the '
https://blog.octo.com/en/walkthrough-watch-your-ansible-deployments-in-grafana/'
link, but it is not working and displays the following message:

[DEPRECATION WARNING]: callback grafana_annotations, does not support
configuration of 'options', will work for now, but this will be necessary
in the future and should be updated,
see the 2.4 portability guide for details. This feature will be removed in
version 2.9. Discontinuance warnings can be disabled by setting
deprecation_warnings = False in ansible.cfg.
[ERROR]: Could not send message to Grafana: HTTP Error 404: not found

My configuration is as follows /etc/ansible/ansible.cfg:
[standards]
roles_path = / etc / ansible / roles
host_key_checking = False
stdout_callback = yaml
callback_whitelist = grafana_annotations
log_path = /var/log/ansible.log
[callback_grafana_annotations]
grafana_url = http://grafana.mydomain.com:3000
grafana_api_key = my_token
validate_grafana_certs = False
grafana_panel_id = 10
callback_plugins = / etc / ansible / callback_plugins /
bin_ansible_callbacks = True

In the / etc / ansible / callback_plugins / directory, it has the following
file:
/etc/ansible/callback_plugins/grafana_annotations.py


What may be the problem?

-- 

Atenciosamente,

Rafael Tomelin

skype: rafael.tomelin

E-mail: rafael.tome...@gmail.com

RHCE  - Red Hat Certified Engineer
PPT-205 - Puppet Certified Professional 2017
Zabbix- ZABBIX Certified Specialist
LPI3
ITIL v3

-- 
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/CAGEUqbBSRnTd05Fm066f9fX0Li4KGO598vTWqQtutvdhu%2B-TFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Tags in loop

2019-01-29 Thread Rafael Tomelin
Hi,

This tag in ansible.  I need set key and value (- key: value), but in variable.

On Tue, Jan 29, 2019 at 7:36 PM Karl Auer  wrote:
>
> What kind of tag? Do you mean an ansible tag, or a tag for e.g. Amazon 
> resources?
>
> If you mean Ansible tags, I do not know.
>
> If you mean AWS tags, most resource modules provide a "tags" attribute, if 
> the resource supports tags. Some resources (generally those with IDs) can be 
> tagged using the ec2_tag module.
>
> Regards, K.
>
>
> On Tue, Jan 29, 2019 at 11:25 PM Rafael Tomelin  
> wrote:
>>
>> Hi dear,
>>
>> I need create tag in my role, this example:
>>
>> vars/main.yml
>> name_variable:
>> tags:
>>key1: value1
>>key2: value2
>>
>> in tasks
>> taks/main.yml
>>
>> - name: name my task
>>   user: name
>>   tags:
>>  tags from vars
>>
>>
>> how can create this tags?
>>
>>
>> --
>> Atenciosamente,
>>
>> Rafael Tomelin
>> Tel.: 51-84104084
>> Skype: rafael.tomelin
>>
>> LPI ID: LPI000191271
>>
>> --
>> 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/CAGEUqbBU%2BN0Byj2aLUDLRwCPgLcYN8X%2BA9yMTns4F5QL0okezQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Karl Auer
>
> Email  : ka...@2pisoftware.com
> Website: http://2pisoftware.com
>
> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>
> --
> 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/CA%2B%2BT08S%3DyOXkTpApiE1om%3D8DcpnT%2Bp8673ZyQshSqeoTAd%2B8iQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbCX98-Nw_B18MkgSCu87o5oSmHvKdttg4YqnL8%2BB4K8bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Tags in loop

2019-01-29 Thread Rafael Tomelin
Hi dear,

I need create tag in my role, this example:

vars/main.yml
name_variable:
tags:
   key1: value1
   key2: value2

in tasks
taks/main.yml

- name: name my task
  user: name
  tags:
 tags from vars


how can create this tags?


-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbBU%2BN0Byj2aLUDLRwCPgLcYN8X%2BA9yMTns4F5QL0okezQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Create variables in hash

2019-01-28 Thread Rafael Tomelin
Hi, thanks

Resolved

On Fri, Jan 25, 2019 at 5:23 PM boncalo mihai  wrote:
>
> key: {{ my_key |  hash('sha1') }} ...
>
> Hashing filters
>
> New in version 1.9.
>
> To get the sha1 hash of a string:
>
> {{ 'test1' | hash('sha1') }}
>
> To get the md5 hash of a string:
>
> {{ 'test1' | hash('md5') }}
>
> Get a string checksum:
>
> {{ 'test2' | checksum }}
>
> Other hashes (platform dependent):
>
> {{ 'test2' | hash('blowfish') }}
>
> To get a sha512 password hash (random salt):
>
> {{ 'passwordsaresecret' | password_hash('sha512') }}
>
> To get a sha256 password hash with a specific salt:
>
> {{ 'secretpassword' | password_hash('sha256', 'mysecretsalt') }}
>
> An idempotent method to generate unique hashes per system is to use a
> salt that is consistent between runs:
>
> {{ 'secretpassword' | password_hash('sha512', 65534 |
> random(seed=inventory_hostname) | string) }}
>
>
>
> On Fri, Jan 25, 2019 at 8:11 PM Rafael Tomelin  
> wrote:
> >
> > Hi dear,
> >
> > How can create variables in hash, example:
> >
> > ---
> > # vars file for roles
> > my_var_root:
> >     my_sub_var:
> > name: example
> > env: environment
> > key: my_key
> >
> > And how, pull in code?
> >
> > --
> > Atenciosamente,
> >
> > Rafael Tomelin
> > Tel.: 51-84104084
> > Skype: rafael.tomelin
> >
> > LPI ID: LPI000191271
> >
> > --
> > 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/CAGEUqbApSGKH40R%3Dt3GLv9mccOK9ezEDsSk-DmTgX-apgP1y_g%40mail.gmail.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+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/CAOK917TQSnXHsV6SbW7uca%2BxOY7WxEDgDjQXSokifo5a1w%3DFMQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbDeZwCeDO7Mc%3DQ8S6bkPBEXC4677S32%2BfKFgii0M7_9rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Create variables in hash

2019-01-25 Thread Rafael Tomelin
Hi dear,

How can create variables in hash, example:

---
# vars file for roles
my_var_root:
my_sub_var:
name: example
env: environment
key: my_key

And how, pull in code?

-- 
Atenciosamente,

Rafael Tomelin
Tel.: 51-84104084
Skype: rafael.tomelin

LPI ID: LPI000191271

-- 
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/CAGEUqbApSGKH40R%3Dt3GLv9mccOK9ezEDsSk-DmTgX-apgP1y_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.