Re: [ansible-project] Cannot decrypt on ubuntu

2019-08-01 Thread Barry Kaplan
I was running `file` just to show the they were ascii.

But thanks, because I *thought* the files where the same. Indeed I was 
sure. But of course they are not.

-- 
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/276c425a-f417-493d-9332-e2631a79baeb%40googlegroups.com.


Re: [ansible-project] How does Ansible deals with the remote prompt?

2019-08-01 Thread Kenneth Wong
I am confused how Ansible Expect Module will work in my use case.

https://docs.ansible.com/ansible/latest/modules/expect_module.html

Is this the Expect Module you mentioned?

>From what I can gather, the Expect Module

1. Connects to remote device and immediately sends the command

2. Look for a set of responses

3. When a response is matched, it sends the corresponding response value

What I need is:

1. Connect to remote device

2. Look for the remote prompt

3. Sends the command

4. Return the command result to the caller

Can you please provive a short example of sending a "ps" command that runs
on the remote device using Ansible Expect Module?

On Wed, Jul 31, 2019 at 10:58 PM Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:

> On 01.08.2019 00:24, Kenneth Wong wrote:
> > Thanks Kai  for your response.
> > Just for clarification. Can Ansible support the following scenario?
> > 1. Ansible ssh into a remote system using username/password.
> > 2. Ansible waits for a specific prompt from the remote side.
> > 3. Ansible than sends the command.
> > 4. Ansible wait for the command response and return the output to the
> > caller.
> > I have a simple Python script using the Paramiko library to perform the
> > above operations.
> > But I am hoping I can use Ansible directly for this to interact with
> > number
> > of remote servers.
> > I looked at the Ansible expect module example and seems like it first
> > sends
> > the command and than look for some response and sends the corresponding
> > response.
> > I also saw the cli_command and that seems to have the interaction I
> > needed
> > but it seemed to be only for network devices.
>
> The expect module is perfect for this.
>
> Instead of letting Ansible do ssh you, you set the task to "delegate_to:
> localhost" and let expect do ssh as the command.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/edeccb1079de619e2cd554056e26e09d%40olstad.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/CAA2Oruy1MqhxJqdQLuD1Dq_2muJwTa0UTzFvfZJwPFtc5Zc2%2Bw%40mail.gmail.com.


Re: [ansible-project] Cannot decrypt on ubuntu

2019-08-01 Thread Kai Stian Olstad
On 02.08.2019 00:41, Barry Kaplan wrote:
> Both the password file and the file being decrypted are ascii
> 
> ~/.ansible❯ file vault-password
> vault-password: ASCII text
> 
> 
> (ansible-2.8) ansible❯ file inventory/aws/ops/group_vars/all/vault_ops.yml
> inventory/aws/ops/group_vars/all/vault_ops.yml: ASCII text

Running file command doesn't prove anything.
But if you do a md5sum of the file both places would ensure that they are equal.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/180db11b-07c4-5169-1807-126d8051b691%40olstad.com.


[ansible-project] Cannot decrypt on ubuntu

2019-08-01 Thread Barry Kaplan
I am working with a project on a new ubuntu installation. On osx I can use 
ansible-vault correctly, but on ubuntu I always get

(ansible-2.8) ansible❯ ansible-vault -v --vault-password-file=~/.ansible/
vault-password view inventory/aws/ops/group_vars/all/vault_ops.yml
Using /home/bkaplan/si/ops/ansible/ansible.cfg as config file
ERROR! Decryption failed (no vault secrets were found that could decrypt) 
on inventory/aws/ops/group_vars/all/vault_ops.yml for inventory/aws/ops/
group_vars/all/vault_ops.yml


The password file is identical to osx, same for the config.cfg (it's from 
git). 

The password has umask of 0600

~/.ansible❯ ll
total 12K
drwx-- 2 bkaplan bkaplan 4.0K Jul  8 16:22 cp
drwx-- 2 bkaplan bkaplan 4.0K Aug  1 15:35 tmp
-rw--- 1 bkaplan bkaplan   25 Jun 17 14:05 vault-password


Same version of ansible on both systems, 2.8.2

Both the password file and the file being decrypted are ascii

~/.ansible❯ file vault-password
vault-password: ASCII text


(ansible-2.8) ansible❯ file inventory/aws/ops/group_vars/all/vault_ops.yml 
inventory/aws/ops/group_vars/all/vault_ops.yml: ASCII text


I have searched and searched, this is not an uncommon error. But I have not 
found any clues as the problem I am having.

Any help would be appreciated.

-- 
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/9e6714c4-230c-4bcf-9a86-b76d3e3e2c90%40googlegroups.com.


Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Veera Mani
When running pup_stat alone, it works.

Adding {{ }} around items did not help



On Fri, Aug 2, 2019, 2:40 AM Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:

> On 01.08.2019 23:05, Veera wrote:
> > Hi,
> >
> > I am trying to  call variables to the shell module  but failing ..
> >
> > - name: status of  services
> >hosts: myhost
> >remote_user: root
> >gather_facts: no
> >vars:
> >  - pp_stat: "/etc/init.d/puppet status"
> >  - pr_date: "echo '= as on  date of ==='; date"
> >
> >strategy: free
> >tasks:
> >  - name: List the   status of the puppet services
> >ignore_errors: yes
> >shell: "{{ item }}"
> >with_items:
> >   -  pp_stat
> >   - pr_date
> >register: pupstat
> >  - debug:
> >  var: pupstat.stdout_lines
> >
> >
> > error reads:
> >
> > TASK [List the   status of the puppet services]
> >
> **
> > failed: [wf-omsal1-01-01] (item=pp_stat) => {"changed": true, "cmd":
> > "pp_stat", "delta": "0:00:00.004792", "end": "2019-08-02
> 01:02:19.344642",
> > "item": "pp_stat", "msg": "non-zero return code", "rc": 127, "start":
> "2019-08-02
> > 01:02:19.339850", "stderr": "/bin/sh: pp_stat: command not found",
> > "stderr_lines": ["/bin/sh: pp_stat: command not found"], "stdout": "",
> > "stdout_lines": []}
> > failed: [wf-omsal1-01-01] (item=pr_date) => {"changed": true, "cmd":
> > "pr_date", "delta": "0:00:00.004765", "end": "2019-08-02
> 01:02:24.356002",
> > "item": "pr_date", "msg": "non-zero return code", "rc": 127, "start":
> "2019-08-02
> > 01:02:24.351237", "stderr": "/bin/sh: pr_date: command not found",
> > "stderr_lines": ["/bin/sh: pr_date: command not found"], "stdout": "",
> > "stdout_lines": []}
> > ...ignoring
> >
> >
> > TASK [debug]
> >
> *
> > ok: [wf-omsal1-01-01] => {
> >  "pupstat.stdout_lines": "VARIABLE IS NOT DEFINED!"
> > }
> >
> > what I am  missing in calling the  variables?
> > using {{ }}  to items  also failed..
>
> Variables in with_items need {{ }} around them.
>
> --
> Kai Stian Olstad
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/8ad-GDtPa6E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/e744297c-9e97-56fa-2459-e7b505a4dc63%40olstad.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/CALNY%2B%2BQWD8X%2B7huJTDj5W6_vVd%3DGyiaN1nuL6%3D%3DaVJb_a9%2BWbQ%40mail.gmail.com.


[ansible-project] Problems loading the playbook

2019-08-01 Thread ronny saavedra


Good night to run this playbook I get an error, I'm extracting data from a 
vcenter.
Thanks I hope you can give me some guidelines on how to solve it.


[image: captura_9.png] 

[image: captura_4.png] 

-- 
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/a56f0957-d9a2-482b-8fa6-dd05844d26a0%40googlegroups.com.


[ansible-project] Receiving facts at localhost using delegate_to is failing

2019-08-01 Thread Gabriel Rios
I have managed in the same playbook to generate certain facts and also to 
go over to my local pc and create the file that will receive them.
What hasn't worked is the transfer of said facts. Below you can see what 
I'm generating in the 1st play, I'm using delegate_to & delegate_facts to 
send the data and in the 2nd play, the last task has to gather those facts 
to add them to the file.

Am I using "delegate" correctly or do I have to gather the delegated facts 
differently? Any help would be greatly appreciated

---
- hosts: prueba
tasks:
- name: Tranferir facts a local
setup:
delegate_to: 10.240.5.82
delegate_facts: true
- name: Pagefile Windows
win_pagefile:
register: win_pf
- set_fact: 
swap_gb: '{{ swap_gb | default([]) + [(item.maximum_size - 
item.initial_size) / 1024] }}'
with_items: "{{ win_pf.pagefiles }}"
delegate_to: 10.240.5.82
delegate_facts: true
- hosts: 10.240.5.82
connection: local
tasks:
- name: Ejecucion local
file:
path: '/home/gabriel/Conex_ansible/reporte.csv'
state: touch
run_once: true
- name: Escribir cabecera en archivo csv
shell: echo 'Host, IP Addr, CPUs, Memoria, OS, Arquitectura, Swap, Disco' > 
/home/gabriel/Conex_ansible/reporte.csv
run_once: true
- name: Escribir reporte
shell: echo "{{ ansible_hostname }}, {{ ansible_ip_addresses[0] }}, {{ 
ansible_processor_vcpus }}, {{ ansible_memtotal_mb }}, {{ ansible_os_name 
}}, {{ ansible_architecture }}, {{ swap_gb }}" >> 
/home/gabriel/Conex_ansible/reporte.csv


Inventory is set to:
10.240.5.82

[prueba]
10.240.30.249:5986 ansible_user=admin ansible_password=password 
ansible_connection=winrm ansible_winrm_server_cert_validation=ignore

Current error points the following:

TASK [Ejecucion local] 
***
changed: [10.240.5.82]

TASK [Escribir cabecera en archivo csv] 
**
changed: [10.240.5.82]

TASK [Escribir reporte] 
**
fatal: [10.240.5.82]: FAILED! => {"msg": "The task includes an option with 
an undefined variable. The error was: 'ansible_ip_addresses' is undefined
\n\nThe error appears to be in 
'/home/gabriel/Conex_ansible/main_reporte.yml': line 44, column 9, but may\nbe 
elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n # fs solo muestra los facts locales.\n - 
name: Escribir reporte\n ^ here\n"}

PLAY RECAP 
***
10.240.30.249 : ok=6 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 
ignored=0 
10.240.5.82 : ok=3 changed=2 unreachable=0 failed=1 skipped=0 rescued=0 
ignored=0 



-- 
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/f53b7dd8-c298-4a5a-8407-e6c7f9ab3f9a%40googlegroups.com.


Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Kai Stian Olstad
On 01.08.2019 23:05, Veera wrote:
> Hi,
> 
> I am trying to  call variables to the shell module  but failing ..
> 
> - name: status of  services
>hosts: myhost
>remote_user: root
>gather_facts: no
>vars:
>  - pp_stat: "/etc/init.d/puppet status"
>  - pr_date: "echo '= as on  date of ==='; date"
> 
>strategy: free
>tasks:
>  - name: List the   status of the puppet services
>ignore_errors: yes
>shell: "{{ item }}"
>with_items:
>   -  pp_stat
>   - pr_date
>register: pupstat
>  - debug:
>  var: pupstat.stdout_lines
> 
> 
> error reads:
> 
> TASK [List the   status of the puppet services]
> **
> failed: [wf-omsal1-01-01] (item=pp_stat) => {"changed": true, "cmd":
> "pp_stat", "delta": "0:00:00.004792", "end": "2019-08-02 01:02:19.344642",
> "item": "pp_stat", "msg": "non-zero return code", "rc": 127, "start": 
> "2019-08-02
> 01:02:19.339850", "stderr": "/bin/sh: pp_stat: command not found",
> "stderr_lines": ["/bin/sh: pp_stat: command not found"], "stdout": "",
> "stdout_lines": []}
> failed: [wf-omsal1-01-01] (item=pr_date) => {"changed": true, "cmd":
> "pr_date", "delta": "0:00:00.004765", "end": "2019-08-02 01:02:24.356002",
> "item": "pr_date", "msg": "non-zero return code", "rc": 127, "start": 
> "2019-08-02
> 01:02:24.351237", "stderr": "/bin/sh: pr_date: command not found",
> "stderr_lines": ["/bin/sh: pr_date: command not found"], "stdout": "",
> "stdout_lines": []}
> ...ignoring
> 
> 
> TASK [debug]
> *
> ok: [wf-omsal1-01-01] => {
>  "pupstat.stdout_lines": "VARIABLE IS NOT DEFINED!"
> }
> 
> what I am  missing in calling the  variables?
> using {{ }}  to items  also failed..

Variables in with_items need {{ }} around them.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e744297c-9e97-56fa-2459-e7b505a4dc63%40olstad.com.


Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Matt Martz
When registering a variable with a loop the structure of the data is
different.

Try doing a debug on just `pupstat` to see the data structure.  See this
documentation for more information:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#registering-variables-with-a-loop

On Thu, Aug 1, 2019 at 4:05 PM Veera  wrote:

> Hi,
>
> I am trying to  call variables to the shell module  but failing ..
>
> - name: status of  services
>   hosts: myhost
>   remote_user: root
>   gather_facts: no
>   vars:
> - pp_stat: "/etc/init.d/puppet status"
> - pr_date: "echo '= as on  date of ==='; date"
>
>   strategy: free
>   tasks:
> - name: List the   status of the puppet services
>   ignore_errors: yes
>   shell: "{{ item }}"
>   with_items:
>  -  pp_stat
>  - pr_date
>   register: pupstat
> - debug:
> var: pupstat.stdout_lines
>
>
> error reads:
>
> TASK [List the   status of the puppet services]
> **
> failed: [wf-omsal1-01-01] (item=pp_stat) => {"changed": true, "cmd":
> "pp_stat", "delta": "0:00:00.004792", "end": "2019-08-02 01:02:19.344642",
> "item": "pp_stat", "msg": "non-zero return code", "rc": 127, "start": 
> "2019-08-02
> 01:02:19.339850", "stderr": "/bin/sh: pp_stat: command not found",
> "stderr_lines": ["/bin/sh: pp_stat: command not found"], "stdout": "",
> "stdout_lines": []}
> failed: [wf-omsal1-01-01] (item=pr_date) => {"changed": true, "cmd":
> "pr_date", "delta": "0:00:00.004765", "end": "2019-08-02 01:02:24.356002",
> "item": "pr_date", "msg": "non-zero return code", "rc": 127, "start": 
> "2019-08-02
> 01:02:24.351237", "stderr": "/bin/sh: pr_date: command not found",
> "stderr_lines": ["/bin/sh: pr_date: command not found"], "stdout": "",
> "stdout_lines": []}
> ...ignoring
>
>
> TASK [debug]
> *
> ok: [wf-omsal1-01-01] => {
> "pupstat.stdout_lines": "VARIABLE IS NOT DEFINED!"
> }
>
> what I am  missing in calling the  variables?
> using {{ }}  to items  also failed..
>
> --
> 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/ece5e2ff-7e5f-4d37-b7c4-64b6394be17c%40googlegroups.com
> 
> .
>


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


[ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Veera
Hi,

I am trying to  call variables to the shell module  but failing ..

- name: status of  services
  hosts: myhost
  remote_user: root
  gather_facts: no
  vars:
- pp_stat: "/etc/init.d/puppet status"
- pr_date: "echo '= as on  date of ==='; date"

  strategy: free
  tasks:
- name: List the   status of the puppet services
  ignore_errors: yes
  shell: "{{ item }}"
  with_items:
 -  pp_stat
 - pr_date
  register: pupstat
- debug:
var: pupstat.stdout_lines


error reads:

TASK [List the   status of the puppet services] 
**
failed: [wf-omsal1-01-01] (item=pp_stat) => {"changed": true, "cmd": 
"pp_stat", "delta": "0:00:00.004792", "end": "2019-08-02 01:02:19.344642", 
"item": "pp_stat", "msg": "non-zero return code", "rc": 127, "start": 
"2019-08-02 
01:02:19.339850", "stderr": "/bin/sh: pp_stat: command not found", 
"stderr_lines": ["/bin/sh: pp_stat: command not found"], "stdout": "", 
"stdout_lines": []}
failed: [wf-omsal1-01-01] (item=pr_date) => {"changed": true, "cmd": 
"pr_date", "delta": "0:00:00.004765", "end": "2019-08-02 01:02:24.356002", 
"item": "pr_date", "msg": "non-zero return code", "rc": 127, "start": 
"2019-08-02 
01:02:24.351237", "stderr": "/bin/sh: pr_date: command not found", 
"stderr_lines": ["/bin/sh: pr_date: command not found"], "stdout": "", 
"stdout_lines": []}
...ignoring


TASK [debug] 
*
ok: [wf-omsal1-01-01] => {
"pupstat.stdout_lines": "VARIABLE IS NOT DEFINED!"
}

what I am  missing in calling the  variables?
using {{ }}  to items  also failed..

-- 
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/ece5e2ff-7e5f-4d37-b7c4-64b6394be17c%40googlegroups.com.


Re: [ansible-project] Re: Viptela Support on Ansible

2019-08-01 Thread Peter Sprygada
https://github.com/ciscodevnet/ansible-viptela

On Thu, Aug 1, 2019 at 3:41 PM 'Tcpip' via Ansible Project
 wrote:
>
> Hello,
>
> How can I configure the playbooks to work with multi-tenant.
>
> THanks.
>
> El jueves, 26 de julio de 2018, 9:47:04 (UTC-3), Eugene Wong escribió:
>>
>> Hi j-16375,
>>
>>
>> We are currently doing a POC with Viptela in the lab and I've written an 
>> Ansible Galaxy module for it.
>>
>> Do you want to try that?
>>
>> Installation is by these commands:
>>
>> pip install viptela-python --upgrade --force
>> ansible-galaxy install eugene_ky_wong.viptela_ansible --force
>>
>> To get the result you need the commands needed are:
>>
>> - cd to the directory which ansible-galaxy installed to
>> - modify variables.yml file to change the 'vManage_server' IP address and 
>> the 'ip_address' of your vEdge, and modify vault.yml for your login 
>> credentials.
>> - run 'ansible-playbook 4_get_interface_stats.yml'
>>
>> Do let me know how that goes!
>>
>>
>> Eugene
>>
>>
>> On Thursday, June 28, 2018 at 3:11:30 AM UTC+8, j-16375 wrote:
>>>
>>> Does anyone have any experience using Ansible with Viptela SD-WAN products 
>>> (vEdge mostly)?  The ios_command module seems to work at a basic level for 
>>> running simple commands but runs into issues with more complex commands.
>>>
>>> For example, using Ansible 2.5.5 and running the following command against 
>>> a vEdge-1000:
>>>
>>> #show interface detail | display xml | nomore
>>>
>>> Partial output is returned, but although the xml format appears correct 
>>> when running command on the device, it appears to get mangled in the 
>>> ansible output.  What are the best ways to approach troubleshooting an 
>>> issue like this?
>>>
>>> Sample output:
>>>
>>> ok: [HOSTNAME] => {
>>> "print_output.stdout_lines": [
>>> [
>>> ""
>>> ],
>>> [
>>> "http://tail-f.com/ns/config/1.0\;>",
>>> "  http://viptela.com/oper-vpn\;>",
>>> "0",
>>> "ge0/0",
>>> "ipv4",
>>> "x.x.x.x/29",
>>> "Up",
>>> "Up",
>>> "NA",
>>> "WAN",
>>> "",
>>> "  0",
>>> "  x.x.x.x/29",
>>> "  x.x.x.x",
>>> "  false",
>>> "",
>>> "null",
>>> "transport",
>>> "1",
>>> "1500",
>>> "80:b7:b9:c7:28:13",
>>> "1000",
>>> "full",
>>> "true",
>>> "tx_pause rx_pause",
>>> "1360",
>>> "16:04:48:50",
>>> "dhcp dns icmp",
>>> "114578914",
>>> "34723478373",
>>> "0",
>>> "14697761",
>>> "110381996",
>>> "20019647115"
>>> ],  <== OUTPUT GETS CORRUPTED HERE
>>> [
>>> "0",
>>> "2",
>>> "258",
>>> "1255",
>>> "234",
>>> "441",
>>> "36925",
>>> "36935",
>>> "139781",
>>> "139204",
>>> "353520",
>>> "0",
>>> "0"
>>> ]
>>> ]
>>> }
>
> --
> 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/036fe650-97ed-4854-803e-f69cb3dd843e%40googlegroups.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/CAKEs6acNBO63mzEpW-f-1B4ADBhHf7tfFsV2n-xp%3DfDybiLL8A%40mail.gmail.com.


[ansible-project] dynamic inventory

2019-08-01 Thread Sloan Miller
I am trying to get dynamic inventory working.  I have not found much on the 
internet or in the docs that give a high level overview as to how the 
configs and files relate.  Any tips?


Can I get some suggestions on my dynamic inventory config?  

Is there a simple way to test and determine whether these two vmware python 
libraries are working as required?

 

- From the link below ---

Requires 'vSphere Automation SDK' and 'vCloud Suite SDK' libraries to be 
installed on the given controller machine.

Please refer following URLs for installation steps

https://code.vmware.com/web/sdk/65/vsphere-automation-python

https://code.vmware.com/web/sdk/60/vcloudsuite-python

https://docs.ansible.com/ansible/latest/plugins/inventory/vmware_vm_inventory.html

-

I am running the ansible.cfg file in my current working directory.


In ansible.cfg 

I have tried these at seperate times and together

inventory   = /etc/ansible/hosts

inventory   = vmware_vm_inventory

[inventory]

enable_plugins = vmware_vm_inventory, host_list, virtualbox, yaml, 
constructed

==

This file is in my current working directory

ansible-admin-> cat test.vmware.yml

plugin: vmware_vm_inventory

strict: False

hostname: remote-vmware-server.com

username: myu...@vsphere.dev.local

password: myPassword

validate_certs: False

with_tags: True


=

To execute and test a playbook with dynamic inventory

ansible-playbook  ../../custom-fact-setup.yml

I tried this too and not working

ansible-playbook  ../../custom-fact-setup.yml -i test.vmware.yml





Error message

[WARNING]:  * Failed to parse 
/etc/ansible/repo/ansible-CPC/custom-facts/files/test.vmware.yml with 
vmware_vm_inventory plugin: Unable to find

'vSphere Automation SDK' Python library which is required. Please refer 
this URL for installation steps - 
https://code.vmware.com/web/sdk/65/vsphere-

automation-python



 

-- 
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/6436a377-2ab2-4077-aef1-bf6831631de4%40googlegroups.com.


Re: [ansible-project] Odd case where I cannot figure out how to eliminate {{ }} in a when: clause

2019-08-01 Thread Kai Stian Olstad
On 01.08.2019 21:58, Brian Coca wrote:
> my issue with 'vars' is that it is not templated for all values, it
> was never meant for direct use and we don't even use internally
> anymore and we hope to remove soon.
> 
> the `vars` lookup does template values correctly and was created for
> that purpose.

vars lookup is not a very good substitute IMHO since it can't handle undefined 
variable very well.
So that leaves us with vars for the foreseeable future.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08b68ab9-0943-6130-94cc-341ce97e76f5%40olstad.com.


Re: [ansible-project] Odd case where I cannot figure out how to eliminate {{ }} in a when: clause

2019-08-01 Thread Brian Coca
my issue with 'vars' is that it is not templated for all values, it
was never meant for direct use and we don't even use internally
anymore and we hope to remove soon.

the `vars` lookup does template values correctly and was created for
that purpose.

-- 
--
Brian Coca

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


[ansible-project] Re: Viptela Support on Ansible

2019-08-01 Thread 'Tcpip' via Ansible Project
Hello,

How can I configure the playbooks to work with multi-tenant.

THanks. 

El jueves, 26 de julio de 2018, 9:47:04 (UTC-3), Eugene Wong escribió:
>
> Hi j-16375,
>
>
> We are currently doing a POC with Viptela in the lab and I've written an 
> Ansible Galaxy module for it.
>
> Do you want to try that?
>
> Installation is by these commands:
>
> pip install viptela-python --upgrade --force
> ansible-galaxy install eugene_ky_wong.viptela_ansible --force
>
> To get the result you need the commands needed are:
>
> - cd to the directory which ansible-galaxy installed to
> - modify variables.yml file to change the 'vManage_server' IP address and 
> the 'ip_address' of your vEdge, and modify vault.yml for your login 
> credentials.
> - run 'ansible-playbook 4_get_interface_stats.yml'
>
> Do let me know how that goes!
>
>
> Eugene
>
>
> On Thursday, June 28, 2018 at 3:11:30 AM UTC+8, j-16375 wrote:
>>
>> Does anyone have any experience using Ansible with Viptela SD-WAN 
>> products (vEdge mostly)?  The ios_command module seems to work at a basic 
>> level for running simple commands but runs into issues with more complex 
>> commands.
>>
>> For example, using Ansible 2.5.5 and running the following command 
>> against a vEdge-1000:
>>
>> #show interface detail | display xml | nomore
>>
>> Partial output is returned, but although the xml format appears correct 
>> when running command on the device, it appears to get mangled in the 
>> ansible output.  What are the best ways to approach troubleshooting an 
>> issue like this?
>>
>> Sample output:
>>
>> ok: [HOSTNAME] => {
>> "print_output.stdout_lines": [
>> [
>> ""
>> ], 
>> [
>> "http://tail-f.com/ns/config/1.0\;>", 
>> "  http://viptela.com/oper-vpn\;>", 
>> "0", 
>> "ge0/0", 
>> "ipv4", 
>> "x.x.x.x/29", 
>> "Up", 
>> "Up", 
>> "NA", 
>> "WAN", 
>> "", 
>> "  0", 
>> "  x.x.x.x/29", 
>> "  x.x.x.x", 
>> "  false", 
>> "", 
>> "null", 
>> "transport", 
>> "1", 
>> "1500", 
>> "80:b7:b9:c7:28:13", 
>> "1000", 
>> "full", 
>> "true", 
>> "tx_pause rx_pause", 
>> "1360", 
>> "16:04:48:50", 
>> "dhcp dns icmp", 
>> "114578914", 
>> "34723478373", 
>> "0", 
>> "14697761", 
>> "110381996", 
>> "20019647115"
>> ],  <== OUTPUT GETS CORRUPTED HERE
>> [
>> "0", 
>> "2", 
>> "258", 
>> "1255", 
>> "234", 
>> "441", 
>> "36925", 
>> "36935", 
>> "139781", 
>> "139204", 
>> "353520", 
>> "0", 
>> "0"
>> ]
>> ]
>> }
>>
>

-- 
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/036fe650-97ed-4854-803e-f69cb3dd843e%40googlegroups.com.


[ansible-project] task to manage repos

2019-08-01 Thread Keith Mills
I need you to add a task to manage repos in the base role. The task should 
perform actions to create the necessary repository entries in the host, 
then trigger an “update packages” type call to verify the host is running 
the latest packages. Repo files are currently located under 
library/repos/*. Care should be taken with the RHEL systems since they have 
a rolling-update model. Performing an update against the LinuxCOE content 
on a RHEL6 host will update everything and in turn, make a RHEL6.2 host 
into a RHEL6e host. For the SLES hosts, the service pack level should 
normally be maintained. SP2 should receive the SP2 repo definition. The 
errata hosts should receive the errata repo. Errata servers should have a 
marker file located at /etc/buildadmin with content errata.

I'm still getting acclimated to creating playbooks, roles, tasks in 
Ansible. Can anyone help me with this? I really would appreciate your help! 
Thank you in advance!

Here are my repos:

Debian

deb6u3-sources.list :
deb http://sdgxfs.sde.rdlabs.hpecorp.net/snapshots/ftp.debian.org/2011.11.26 
squeeze main contrib



deb7e-sources.list:
#


# deb cdrom:[Debian GNU/Linux 7.11.0 _Wheezy_ - Official amd64 DVD Binary-1 
20160605-17:36]/ wheezy contrib main


# deb cdrom:[Debian GNU/Linux 7.11.0 _Wheezy_ - Official amd64 DVD Binary-1 
20160605-17:36]/ wheezy contrib main


# Lines commented out by installer because it failed to verify:


#deb http://security.debian.org/ wheezy/updates main contrib non-free


#deb-src http://security.debian.org/ wheezy/updates main contrib non-free


# wheezy-updates, previously known as 'volatile'


# A network mirror was not selected during install.  The following entries


# are provided as examples, but you should amend them as appropriate


# for your mirror of choice.


#


#deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free


#deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free


#deb http://linuxcoe9.houston.hpecorp.net/LinuxCOE/Debian/ wheezy main 
contrib non-free


#deb-src http://linuxcoe9.houston.hpecorp.net/LinuxCOE/Debian/ wheezy main 
contrib non-free


#deb http://linuxcoe9.houston.hpecorp.net/LinuxCOE/Debian/ wheezy-updates 
main contrib non-free


#deb-src http://linuxcoe9.houston.hpecorp.net/LinuxCOE/Debian/ 
wheezy-updates main contrib non-free


#deb http://ftp.debian.org/debian/ Debian7.11 main contrib non-free


#deb-src http://ftp.debian.org/debian/ Debian7.11 main contrib non-free


deb http://archive.debian.org/debian wheezy main contrib


deb8e-sources.list :
deb http://deb.debian.org/debian/ jessie main contrib non-free
deb-src http://deb.debian.org/debian/ jessie main contrib non-free


deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free



RedHat

rh6ex64-linuxcoe.repo:
# epel
[RedHat-6.6Server-x86_64-EPEL]
name=RedHat 6.6Server x86_64 - EPEL
baseurl=http:
//linuxcoe9.houston.hpecorp.net/linuxcoe/Fedora-EPEL/6Server/x86_64
enabled=1
gpgcheck=0


[RedHat-6.6Server-x86_64-optional]
name=RedHat-6.6Server-x86_64-optional
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/6.6Server-optional/en/os/x86_64
enabled=1
gpgcheck=0


# updates x86_64
[RedHat-6.6Server-x86_64-errata]
name=RedHat-6.6Server-x86_64-errata
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/6.6Server/en/os/x86_64
#exclude=kernel-smp* kernel-devel* kernel-bigmem* kernel-source* 
kernel-sourcecode* kernel-2* kernel-defaul* kernel-header* kernel-bigsmp 
kernel kernel-PAE* kernel-[0-9]*
enabled=1
gpgcheck=0


# updates noarch
[RedHat-6.6Server-i386-errata]
name=RedHat-6.6Server-i386-errata
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/6.6Server/en/os/i386
#exclude=kernel-smp* kernel-devel* kernel-bigmem* kernel-source* 
kernel-sourcecode* kernel-2* kernel-defaul* kernel-header* kernel-bigsmp 
kernel kernel-PAE* kernel-[0-9]*
enabled=1
gpgcheck=0


rh6u2x64-linuxcoe.repo:
[RedHat-6.2Server-x86_64]
name=RedHat 6.2Server x86_64
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-yum/6.2Server/en/os/x86_64
enabled=1
gpgcheck=0


# epel
[RedHat-6.2Server-x86_64-EPEL]
name=RedHat 6.2Server x86_64 - EPEL
baseurl=http://linuxcoe9.houston.hpecorp.net/LinuxCOE/Fedora-EPEL/6/x86_64
enabled=1
gpgcheck=0


# optional
# Need to enable this for initial install, but be careful because if you 
update with it enabled it can break things
[RedHat-6.2Server-x86_64-optional]
name=RedHat-6.2Server-x86_64-optional
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/6Server-optional/en/os/x86_64
enabled=0
gpgcheck=0


# updates x86_64
[RedHat-6.2Server-x86_64-errata]
name=RedHat-6.2Server-x86_64-errata
baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/6.2Server/en/os/x86_64
#exclude=kernel-smp* kernel-devel* kernel-bigmem* kernel-source* 
kernel-sourcecode* kernel-2* 

[ansible-project] Re: how to solve local_action -> unreachable?

2019-08-01 Thread Gabriel Rios
Maybe you've wondered why I don't just set everything to local. My playbook 
contains other tasks to pull facts from a Windows machine. That's why I 
have the connection configured for winrm. Then I want to retrieve those 
facts into a .csv file created locally, which is what is failing.

Update: 

I have used delegate_to: localhost too, without success.

I added this to the playbook expecting to connect to my pc:
- name: change connection 
add_host:
hostname: name
ansible_user: myuser
ansible_password: mypassphrase
ansible_port: 22
ansible_connection: ssh
changed_when: true

Seems it doesn't actually change the connection
TASK [change connection] 
***
changed: [10.240.30.249]

TASK [execute locally] 
***
 [WARNING]: No python interpreters found for host 10.240.30.249 (tried 
['/usr/bin/python', 'python3.7',
'python3.6', 'python3.5', 'python2.7', 'python2.6', 
'/usr/libexec/platform-python', '/usr/bin/python3',
'python'])

fatal: [10.240.30.249]: FAILED! => {"ansible_facts": 
{"discovered_interpreter_python":... and so on.




On Wednesday, 31 July 2019 16:34:02 UTC-5, Gabriel Rios wrote:
>
> Hi,
>
> I'm currently experiencing a problem when executing the following 
> playbook. Everything I'm currently executing is attached too. What should I 
> modify? 
>
> ---
> - hosts: all
> vars_files:
> - winrms.yml
> tasks:
> - name: execute locally
> local_action:
> module: file
> path: /home/gabriel/Conex_ansible/reporte.csv
> state: touch
>
> It gives the error
> fatal: [10.240.30.249]: UNREACHABLE! => {"changed": false, "msg": "ssl: 
> HTTPSConnectionPool(host='localhost', port=5986): 
> Max retries exceeded with url: /wsman (Caused by 
> NewConnectionError(' at 0x7fd25dd28590>: Failed to establish a new connection: [Errno 111] 
> Connection refused',))", "unreachable": true} 
>
> I am currently connected to a Windows server, inventory.ini only contains 
> the IP address of said server and winrms.yml contains:
> ---
> ansible_user: user
> ansible_password: password
> ansible_port: 5986
> ansible_connection: winrm
> ansible_winrm_server_cert_validation: ignore
>
>
>
>
>

-- 
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/8bd27a92-1931-42ad-bb83-98d9dd44543d%40googlegroups.com.


Re: [ansible-project] /etc not writable

2019-08-01 Thread Yuriy Buha
No, do not have root, but I do have sudo access that allows me to chown of 
/etc

On Friday, July 28, 2017 at 8:35:30 AM UTC-4, Fayad wrote:
>
> Changing ownership of /etc is not a proper way. So you have root access??
>
> Fayad
>
> Sent from my OnePlus One
>
> On 22-Jul-2017 5:37 PM, "Yuriy Buha" > 
> wrote:
>
>> Hi Fayad. 
>>
>> Thank you for the quick reply. 
>> I tried to create the file in user's home directory, and then move to the 
>> /etc, but then i would get a permission error moving the file to that 
>> directory.
>> It worked after i changed the ownership of /etc from root to the user, 
>> but i'm not sure if that's a proper way to do. Is it ok for the /etc 
>> directory to be owned by the user but not root?
>>
>> thank you
>>
>> On Friday, July 21, 2017 at 9:38:49 AM UTC-4, Fayad wrote:
>>>
>>> Try these options
>>>
>>> Copy the file to the sudo user's home directory or any other directory 
>>> where the user has got permission.
>>>
>>> Or
>>>
>>> Increase the permissions of the destination directory so that user can 
>>> write into that directory.
>>>
>>>
>>>
>>> Fayad
>>>
>>> Sent from my OnePlus One
>>>
>>> On 21-Jul-2017 6:33 PM, "Yuriy Buha"  wrote:
>>>
 Hello. 

 I have similar case, and i get this error, but i do need to create it 
 as sudo user. I do not have root privilege.
 Can someone please advise?

 Thank you

 On Friday, May 6, 2016 at 11:44:08 AM UTC-4, Kai Stian Olstad wrote:
>
> On 06. May 2016 14:46, Sanjay Kumar wrote: 
> > I am not able copy to remote host, getting not writable error, my 
> playbook 
> > is here. 
> > 
> > --- 
> >  - hosts: all 
> >become: yes 
> >become_user: sanjay 
> >become_method: sudo 
> >tasks: 
> >  - name: copy some file 
> >copy: src=/home/sanjay/messages dest=/etc 
>
> become_user: sanjay, means Ansible will do a sudo to user sanjay. So 
> sanjay need permission to the destination. 
>
> I guess what you really want is become_user: root , which is the 
> default. 
>
> -- 
> 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-proje...@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/d2d870d5-5ff6-4503-9096-0e4a183ae6eb%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...@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/78612bcc-e25c-4ee5-9dd0-d5e833a3a696%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7926b85b-dcf4-4adf-a3db-a832117c1135%40googlegroups.com.


Re: [ansible-project] Re: Ansible as a Packer provisioner hanging?

2019-08-01 Thread Matt Martz
This is being tracked in https://github.com/ansible/ansible/issues/57542

The problem is that Ansible ssh pipelining does not work with the packer
ssh proxy.  To a further extent, the new python interpreter discovery in
ansible 2.8 uses pipelining.

You can set ansible_python_interpreter=/usr/bin/python3.6 (or whatever
interpreter you want to use), and then also ensure that you have pipelining
turned off.

On Wed, Jul 31, 2019 at 10:26 PM Bob Tanner  wrote:

> I can ssh to the public IP address of the Packer AMI but Ansible being run
> as a provisioner in Packer shows this log:
>
> amazon-ebs: <127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: ubuntu
> amazon-ebs: <127.0.0.1> SSH: EXEC ssh -vvv -o IdentitiesOnly=yes -o
> StrictHostKeyChecking=no -o Port=50328 -o
> 'IdentityFile="/var/folders/y_/w_pbl7355vg3gv5xkmsld49mgn/T/ansible-key347004316"'
> -o KbdInteractiveAuthentication=no -o
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
> -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10
> 127.0.0.1 '/bin/sh -c '"'"'/usr/bin/python3.6 && sleep 0'"'"''
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 SSH proxy: accepted
> connection
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 authentication attempt
> from 127.0.0.1:50333 to 127.0.0.1:50328 as ubuntu using none
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 authentication attempt
> from 127.0.0.1:50333 to 127.0.0.1:50328 as ubuntu using publickey
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 new env request:
> LANG=en_US.UTF-8
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 new exec request: /bin/sh
> -c '/usr/bin/python3.6 && sleep 0'
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 [INFO] 1234 bytes written
> for 'stdin'
> 2019/07/31 22:18:52 [INFO] 1234 bytes written for 'stdin'
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 [DEBUG] Opening new ssh
> session
> 2019/07/31 22:18:52 packer: 2019/07/31 22:18:52 [DEBUG] starting remote
> command: /bin/sh -c '/usr/bin/python3.6 && sleep 0'
>
> As I understand it Packer running an ssh proxy
>
> $ telnet localhost port
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> SSH-2.0-Go
>
> So Packer (Go) is being a proxy to the Packer AMI but I never see any sort
> of login attempts in /var/log/syslog on the Packer AMI then I try to "ssh
> 127.0.0.1 port"
>
> Even more weird, in a terminal windows, not trying to run python, just
> attempting to get a shell (complete log at
> https://gist.github.com/basictheprogram/3696f33543a0edc7eacdee76c54c8452)
>
> shell request failed on channel 0
>
>
>
>
> --
> 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/ab0884b8-ce2e-47c1-843f-c1a1eb5ca890%40googlegroups.com
> 
> .
>


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


Re: [ansible-project] Best way to organize your playbooks

2019-08-01 Thread Михаил Политаев
Think re-examine how i look into the roles is helped to me. Now after i 
reorganize my roles slightly different is helped for me:

Each role have purpose of install nginx, monitoring, etc. 

And after that high level playbook will combine them together to get 
application worked. For example distributed wordpress, or ha lamp stack 
rather than I have before each role to configure application. 

четверг, 1 августа 2019 г., 11:51:47 UTC+2 пользователь Andrew Feller 
написал:
>
> You might re-examine whether it is appropriate for a role and a playbook 
> as it feels like your playbooks are too heavy.
>
> Roles ideally should be reusable logic for a given context you can apply 
> to multiple situations.  For example, you might have multiple 
> kafka/mysql/etc clusters for different uses that a single role given the 
> necessary info via playbook and inventory can manage.  If you need to build 
> higher order reusable roles, you can have roles with dependent roles that 
> compose them to your ends; leaving your playbooks thinner.  Playbooks 
> ultimately should be highest order orchestration that isn’t bogged down 
> into all of the technical details.
>
> Say what you will about Puppet but I would consider the reasoning behind 
> their roles and profiles and how it applies to Ansible: 
> https://puppet.com/docs/pe/2018.1/the_roles_and_profiles_method.html
>
>
> Sent from my iPhone
>
> On Aug 1, 2019, at 1:49 AM, Михаил Политаев  > wrote:
>
> Awesome! Looks like a plan! Thanks!
>
> чт, 1 авг. 2019 г. в 07:44, Sebastian Meyer  >:
>
>> On 01.08.19 07:31, Михаил Политаев wrote:
>> > I have a several projects which describing installation 2 different 
>> > applications. Each directory for application:
>> > 
>> > app1/roles/common/main.yml
>> > app2/roles/common/main.yml
>> > 
>> > But application have similar between them tasks which described in 
>> > "main.yml" of role "common"
>> > 
>> > What is the best way have only one source to those similar tasks 
>> without 
>> > having 2 or more versions and duplicate them across projects.
>> You could make use of the roles_path configuration setting [0] and have
>> a directory structure like this:
>>
>> ansible/
>>   common/roles/
>>   app1/roles/
>>   app2/roles/
>>
>> and in the app folders each an ansible.cfg with:
>>
>> roles_path: ./roles:../common/roles
>>
>> [0]
>>
>> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/AzH2GwEA9Ls/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/8f7c5bb5-aaa6-4de2-7031-c0cdd4a538db%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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAKP%3D2uxpjLjmXm9qympt%3DsbDXMg1%3DP1DHxmh%2B0GNv3XGKRYxDg%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/f8448e04-06a3-4206-9fff-c3a6d0debfe0%40googlegroups.com.


Re: [ansible-project] How to use piping multiple shell commands

2019-08-01 Thread Veera
Thanks Vinoth.  It worked

Yes . I learnt that we can use the formatting as in python either with ' '  
or  " ".




On Thursday, August 1, 2019 at 8:59:32 AM UTC+5:30, vinoth kumar wrote:
>
>
>
> On Thu, 1 Aug 2019 at 8:57 AM, vinoth kumar  > wrote:
>
>> Error clearly says to use proper quotes 
>> This would be fine i think so 
>> “netstat -nautp |grep -iE ‘137|389|445|636’|awk '{print $5}' |cut -d: 
>> -f2 |grep -iwE ‘137|389|445|636’”
>> Save it in Regiter
>> Use set_facts to store as a variable 
>>
>>
>> On Thu, 1 Aug 2019 at 8:31 AM, Veera > 
>> wrote:
>>
>>> Hi,
>>>
>>> I am trying the below   snippet to  detect  the established ports.  but 
>>> Ansible throws an error.
>>>
>>>  - name: List the  port connections 
>>>   shell: "netstat -nautp |grep -iE "137|389|445|636" |awk '{print 
>>> $5}' |cut -d: -f2 |grep -iwE "137|389|445|636"
>>>   register: dc_stat
>>>   debug:
>>> var: dc_stat.stdout_lines
>>>
>>> this through's the error
>>>
>>> The offending line appears to be:
>>>
>>>
>>> - name: List the  port connections 
>>>   shell: netstat -nautp |grep -iE "137|389|445|636" |awk '{print 
>>> $5}' |cut -d: -f2 |grep -iwE "137|389|445|636"
>>> 
>>>  ^ here
>>> We could be wrong, but this one looks like it might be an issue with
>>> unbalanced quotes.  If starting a value with a quote, make sure the
>>> line ends with the same set of quotes.  For instance this arbitrary
>>> example:
>>>
>>>
>>> foo: "bad" "wolf"
>>>
>>>
>>> Could be written as:
>>>
>>>
>>> foo: '"bad" "wolf"'
>>>
>>>
>>>
>>> I tried  inserted  a " " for the shell commands  and using  vars/pipe 
>>> also .. 
>>> How can i direct the output of "netstat -nautp |grep -iE "137|389|445|
>>> 636" |awk '{print $5}' |cut -d: -f2 |grep -iwE "137|389|445|636"" to a 
>>> variable  ?
>>>
>>> Or  do we have to use backslash(\)  as in shell ?
>>>
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/3e2a9fa0-7974-4455-baa6-f45b2f690aae%40googlegroups.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/b1841eaa-5c31-4a98-b975-a279a020d22c%40googlegroups.com.


[ansible-project] Help for variable defination

2019-08-01 Thread Rahul Kumar
HI Ansible Gurus,
I have a specific snippet of code which i defined in default/main.yaml of a
role xyz.

sw_yum_repositories:
  - name: sw
description: Dangerous sw
file: sw-gw
baseurl: ""
enabled: no
gpgcheck: "{{gpgcheckall | default('yes')}}"
gpgkey: "{{sw_repository_gpgkey | default(gpgkeys) | default('')}}"

Now I override this variable sw_yum_repostories in my group_vars/all.yml
in inventory configuration files.  Problem here is : i want to take default
value of gpgkey attribute here from default/main.yml and other attributes i
am overriding in group_vars/all.yml .  But when I try to define
sw_yum_repostories without gpgkey attribute , it does not take default from
default/main.yaml (it is part of source code) and whatever we define in
group_vars/all.yml(overidden ones) , it takes. Since gpgkey is something i
want to take from default/main.yml(because it is less subject to change)
rather than overriding and rest all attribute i want to override in
group_vars/all.yml, how can i achieve this ?
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/CAGH8rEw2z3cJh6WAOMq_a7%2BKy5uGzA-6j22MG5B1QXTJOBdGFA%40mail.gmail.com.


[ansible-project] Ansible with windows

2019-08-01 Thread Irfan Pasha
Hi,

I have been using ansible for a while and I love it. It just makes complex 
things very easy. So far I have been ansible on CentOS and it has been a 
cake walk. Now I have to do some automation on windows and I see that the 
WinRM is very slow. I see that just Gathering facts itself from a linux 
ansible client to a remote windows server takes almost 5+ seconds. I would 
like to know how people in community use ansible with windows. I use packer 
with VSphere and execute ansible. Do people use vsphere or mostly Azure,AWS 
and docker ? 

If you think your ansible + windows is faster, please share your thoughts 
and configurations that make them run more faster. 

Thank you !

Regards,
Irfan

-- 
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/90c4797a-a772-4280-a7d9-b73ee00e0c59%40googlegroups.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] Best way to organize your playbooks

2019-08-01 Thread Andrew Feller
You might re-examine whether it is appropriate for a role and a playbook as it 
feels like your playbooks are too heavy.

Roles ideally should be reusable logic for a given context you can apply to 
multiple situations.  For example, you might have multiple kafka/mysql/etc 
clusters for different uses that a single role given the necessary info via 
playbook and inventory can manage.  If you need to build higher order reusable 
roles, you can have roles with dependent roles that compose them to your ends; 
leaving your playbooks thinner.  Playbooks ultimately should be highest order 
orchestration that isn’t bogged down into all of the technical details.

Say what you will about Puppet but I would consider the reasoning behind their 
roles and profiles and how it applies to Ansible: 
https://puppet.com/docs/pe/2018.1/the_roles_and_profiles_method.html


Sent from my iPhone

> On Aug 1, 2019, at 1:49 AM, Михаил Политаев  wrote:
> 
> Awesome! Looks like a plan! Thanks!
> 
> чт, 1 авг. 2019 г. в 07:44, Sebastian Meyer :
>> On 01.08.19 07:31, Михаил Политаев wrote:
>> > I have a several projects which describing installation 2 different 
>> > applications. Each directory for application:
>> > 
>> > app1/roles/common/main.yml
>> > app2/roles/common/main.yml
>> > 
>> > But application have similar between them tasks which described in 
>> > "main.yml" of role "common"
>> > 
>> > What is the best way have only one source to those similar tasks without 
>> > having 2 or more versions and duplicate them across projects.
>> You could make use of the roles_path configuration setting [0] and have
>> a directory structure like this:
>> 
>> ansible/
>>   common/roles/
>>   app1/roles/
>>   app2/roles/
>> 
>> and in the app folders each an ansible.cfg with:
>> 
>> roles_path: ./roles:../common/roles
>> 
>> [0]
>> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path
>> 
>> -- 
>> 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 a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/AzH2GwEA9Ls/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/8f7c5bb5-aaa6-4de2-7031-c0cdd4a538db%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/CAKP%3D2uxpjLjmXm9qympt%3DsbDXMg1%3DP1DHxmh%2B0GNv3XGKRYxDg%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/5DF1BE05-95B3-4A93-85D8-299B45C57436%40gmail.com.


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.


Re: [ansible-project] Ansible Playbook iterating through different variable files

2019-08-01 Thread Kai Stian Olstad

On 31.07.2019 16:32, Kristiyan Zdravkov wrote:
Could you please advise me whether I can iterate separately to each of 
the

variable files in the directory prod with Ansible and how to do it.


You would need to include_vars on one file, do some task(s), and then 
include the next var and do some task(s) and so on.


With include_tasks you can loop over a yaml file with one or more tasks 
in it.


The variable files you can add in a variable that you use in the loop, 
if you need get the variable dynamicly use the find module.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a9bf31ed78f2c63ecd5e5026ee241ac7%40olstad.com.