[ansible-project] Re: Need some suggestion

2020-04-13 Thread Rahul Kumar
Guys any help on this ?

On Mon, 13 Apr 2020 at 18:38, Rahul Kumar  wrote:

> Hi Ansible Gurus,
> I need some help for some framework designing based on Ansible. I have
> many components and i have maintained ansible role for each component
> deployment in common project.
> Means all components installation/configuration managed by that common
> project .
>
> I wanted to bring a framework , that rather than keep all component roles
> in a single common project , distribute each component
> installation/configuration (role) to individual component git repos, so
> that whenever component changes its actual application code base, it can
> change corresponding Ansible code also in same repo if required.
> So common project (a big molecule) will be spilitted  and still some
> common operations/cross cutting features  i want to maintain in common
> project only which can be applied on all components.
>
> So i need some kind of Interface between common project Ansible code and
> all other components ansible codes.
>
> How can i achieve this ?
> Any suggestion is welcomed, its more like a design problem if one wants to
> manage multiple component installation/configuration . So which is better
> approach
> 1. Maintaining all components installation/configuration Ansible roles in
> single project
> 2. Have only common cross cutting operations in single or common project
> and distribute component specific code to individual component code repo
> and then interface between Common project Ansible code and individual
> component ansible code some how.
>
> Did anyone came across such design problems ?
>
> Regards
> 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/CAGH8rEz-zYi81pS15as%2BsULqj6cBVb6X00cwEZr21%2BhU-vaYmg%40mail.gmail.com.


Re: [ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread Tony Wong
when i run that it gave me govc: please specify a datacenter

tony@ubuntu:~/ansible-vmware/ansible-add-esxi-host$ govc about
Name: VMware vCenter Server
Vendor:   VMware, Inc.
Version:  6.7.0
Build:15976728
OS type:  linux-x64
API type: VirtualCenter
API version:  6.7.3
Product ID:   vpx
UUID: 4f7ea0f6-72b5-4d7c-9119-755870852497

On Mon, Apr 13, 2020 at 1:03 PM Jorge Rúa  wrote:

> Best thing you can do to understand how vCenter is organized is using govc
> tool:
>
> For example, this is my home lab:
>
> ➜   govc about
> Name: VMware vCenter Server
> Vendor:   VMware, Inc.
> Version:  *6.7.0*
> Build:15129973
> OS type:  linux-x64
> API type: VirtualCenter
> API version:  6.7.3
> Product ID:   vpx
> UUID: 1a93cd0c-f7f7-4021-a232-7ca15c73f8bd
>
> In this case the only esxi host belong to a datacenter called DC01, in
> cluster CLUSTER01, and esxi host is 192.168.10.200.
>
> ➜  govc host.info 192.168.10.200
> Name:  192.168.10.200
>   Path:*/DC01/host/CLUSTER01/192.168.10.200
> *
>   Manufacturer:Dell Inc.
>   Logical CPUs:4 CPUs @ 3408MHz
>   Processor type:  Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
>   CPU usage:   698 MHz (5.1%)
>   Memory:  32628MB
>   Memory usage:16856 MB (51.7%)
>   Boot time:   2020-03-21 16:00:52.643186 + UTC
>   State:   connected
>
> Regards,
>
>
>
> El lun., 13 abr. 2020 a las 20:58, Tony Wong ()
> escribió:
>
>> how do i specify this folder? The is a vcenter folder and I need to add
>> it to the HK datacenter
>>
>> On Mon, Apr 13, 2020 at 12:47 PM Tony Wong  wrote:
>>
>>> Hi,
>>>
>>> Thanks. what would the host be under '/DC01/host/myhostfolder' ?
>>>
>>> I have a parent folder that I need to add the host into but its not
>>> taking it.
>>>
>>> can i specify a vcenter folder ?
>>>
>>>
>>> --
>>> 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/6a9eded3-8e2d-4e77-9d38-2ad90732e6a7%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/CALmkhkrZeyoCbseLubxwf_QRUQBbLqMkrjdJ1EMHaZngLRteLg%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/CAFtje5OtU-EPhU3e9XxQijoR9nTtJ1WuBDOi-0FoXO-z%2B6n5Zw%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/CALmkhkoqXq7SshcUBE9kAi3m8aLet1VLRFaqVmZVHGXCJc8iug%40mail.gmail.com.


Re: [ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread Jorge Rúa
Best thing you can do to understand how vCenter is organized is using govc
tool:

For example, this is my home lab:

➜   govc about
Name: VMware vCenter Server
Vendor:   VMware, Inc.
Version:  *6.7.0*
Build:15129973
OS type:  linux-x64
API type: VirtualCenter
API version:  6.7.3
Product ID:   vpx
UUID: 1a93cd0c-f7f7-4021-a232-7ca15c73f8bd

In this case the only esxi host belong to a datacenter called DC01, in
cluster CLUSTER01, and esxi host is 192.168.10.200.

➜  govc host.info 192.168.10.200
Name:  192.168.10.200
  Path:*/DC01/host/CLUSTER01/192.168.10.200
*
  Manufacturer:Dell Inc.
  Logical CPUs:4 CPUs @ 3408MHz
  Processor type:  Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
  CPU usage:   698 MHz (5.1%)
  Memory:  32628MB
  Memory usage:16856 MB (51.7%)
  Boot time:   2020-03-21 16:00:52.643186 + UTC
  State:   connected

Regards,



El lun., 13 abr. 2020 a las 20:58, Tony Wong ()
escribió:

> how do i specify this folder? The is a vcenter folder and I need to add it
> to the HK datacenter
>
> On Mon, Apr 13, 2020 at 12:47 PM Tony Wong  wrote:
>
>> Hi,
>>
>> Thanks. what would the host be under '/DC01/host/myhostfolder' ?
>>
>> I have a parent folder that I need to add the host into but its not
>> taking it.
>>
>> can i specify a vcenter folder ?
>>
>>
>> --
>> 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/6a9eded3-8e2d-4e77-9d38-2ad90732e6a7%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/CALmkhkrZeyoCbseLubxwf_QRUQBbLqMkrjdJ1EMHaZngLRteLg%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/CAFtje5OtU-EPhU3e9XxQijoR9nTtJ1WuBDOi-0FoXO-z%2B6n5Zw%40mail.gmail.com.


Re: [ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread Tony Wong
how do i specify this folder? The is a vcenter folder and I need to add it
to the HK datacenter

On Mon, Apr 13, 2020 at 12:47 PM Tony Wong  wrote:

> Hi,
>
> Thanks. what would the host be under '/DC01/host/myhostfolder' ?
>
> I have a parent folder that I need to add the host into but its not taking
> it.
>
> can i specify a vcenter folder ?
>
>
> --
> 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/6a9eded3-8e2d-4e77-9d38-2ad90732e6a7%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/CALmkhkrZeyoCbseLubxwf_QRUQBbLqMkrjdJ1EMHaZngLRteLg%40mail.gmail.com.


Re: [ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread Tony Wong
Hi,

Thanks. what would the host be under '/DC01/host/myhostfolder' ?

I have a parent folder that I need to add the host into but its not taking 
it. 

can i specify a vcenter folder ?


-- 
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/6a9eded3-8e2d-4e77-9d38-2ad90732e6a7%40googlegroups.com.


Re: [ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread Jorge Rúa
Hi Tony,

There are two ways of adding an esxi host to vCenter:

   - In standalone mode (not part of a vCenter cluster)
   - Part of a vCenter cluster

See the following examples:

In standalone mode, first you'll need a host folder to place your esxi
hosts. Bear in mind here that *vcenter_folder* should be in the following
form: /datacenter_name/host/name. For example if your dc is DC01:
/DC01/host/myhostfolder.

- name: Create a host folder
vcenter_folder:
hostname: "{{ hostvars[inventory_hostname]['vcenter'] }}"
username: "{{ vcenter_username | d(ansible_ssh_user) }}"
password: "{{ vcenter_password | d(ansible_ssh_pass) }}"
datacenter_name: "{{ datacenter_name }}"
folder_name: "{{ vcenter_folder }}"
folder_type: host
state: present
validate_certs: False
register: folder_result
delegate_to: localhost
run_once: True
retries: 10
until: folder_result is succeeded
- name: Add host to vCenter (standalone)
vmware_host:
hostname: "{{ hostvars[inventory_hostname]['vcenter'] }}"
username: "{{ vcenter_username | d(ansible_ssh_user) }}"
password: "{{ vcenter_password | d(ansible_ssh_pass) }}"
datacenter_name: "{{ datacenter_name }}"
folder: "{{ vcenter_folder }}"
esxi_hostname: "{{ hostvars[inventory_hostname]['fqdn'] }}"
esxi_username: "{{ esxi_admin_username | d('root') }}"
esxi_password: "{{ esxi_root_password | d('password') }}"
state: present
validate_certs: False
delegate_to: localhost
register: host_result
retries: 10
until: host_result is succeeded

Next option is to add a esxi host into an existing cluster:

- name: Attach esxi host to vCenter cluster
vmware_host:
hostname: "{{ hostvars[inventory_hostname]['vcenter'] }}"
username: "{{ vcenter_username | d(ansible_ssh_user) }}"
password: "{{ vcenter_password | d(ansible_ssh_pass) }}"
datacenter_name: "{{ datacenter_name }}"
cluster_name: "{{ cluster_name }}"
esxi_hostname: "{{ hostvars[inventory_hostname]['fqdn'] }}"
esxi_username: "{{ esxi_admin_username | d('root') }}"
esxi_password: "{{ esxi_root_password | d('password') }}"
state: present
validate_certs: False
delegate_to: localhost

Hope it helps,

Regards

--

Jorge Rua


El lun., 13 abr. 2020 a las 17:35, David Foley ()
escribió:

> Hi Tony,
>
> Looking at the Documentation
> https://docs.ansible.com/ansible/latest/modules/vmware_host_module.html
>
> - name: Add ESXi Host to vCenter
>   vmware_host:
> hostname: '{{ vcenter_hostname }}'
> username: '{{ vcenter_username }}'
> password: '{{ vcenter_password }}'
> datacenter: datacenter_name
> cluster: cluster_name
> esxi_hostname: '{{ esxi_hostname }}'
> esxi_username: '{{ esxi_username }}'
> esxi_password: '{{ esxi_password }}'
> state: present
>   delegate_to: localhost
>
> This code will add the host to a Cluster,
>
>
> On Monday, April 13, 2020 at 4:48:40 PM UTC+1, Tony Wong wrote:
>>
>> I am new to ansible and want to know how to add a esxi host to vcenter in
>> a datacenter
>>
>> I have the following in a yml file but not sure what else to do
>>
>>
>> - hosts: localhost
>>   connection: local
>>   tasks:
>> - name: include vars
>>   include_vars:
>>
>> - name: Add ESXi Host to vCenter
>>   vmware_host:
>> hostname: '{{ vcenter_hostname }}'
>> username: '{{ vcenter_username }}'
>> password: '{{ vcenter_password }}'
>> datacenter: datacenter_name
>> esxi_hostname: '{{ esxi_hostname }}'
>> esxi_username: '{{ esxi_username }}'
>> esxi_password: '{{ esxi_password }}'
>> state: present
>>   delegate_to: localhost
>> ~
>>
>>
>>
>>
>> please help as vmware ansible seems very limited in info
>>
> --
> 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/7d76788c-cc3f-4530-80cd-626b4700cf1c%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/CAFtje5O75ezCDVm0eM5QX3WKd-r6ujGzd9k_v4Qd898auLrznQ%40mail.gmail.com.


[ansible-project] Iterating ansible_mounts and adding items to a list

2020-04-13 Thread harry devine
I'm trying to come up a way to iterate through ansible_mounts and, if one 
of the mounts is over 80% used, add that to a list that i can print out 
later and possibly email it.  Here's what I have so far:

---
- hosts: localhost
  gather_facts: no
  become: yes
  become_method: sudo

  pre_tasks:
- setup:
filter: 'ansible_mounts'

  tasks:

   - name: Show the mounts and disk usage
 debug:
   msg: "Disk usage: {{ item.mount }} is {{ (100 * ((item.size_total - 
item.size_available)/item.size_total))| float | round(1, 'common') }}%"
 when: "(100 * ((item.size_total - 
item.size_available)/item.size_total)) > 80"
 with_items:
   - "{{ ansible_mounts }}"
 loop_control:
   label: "{{ item.mount }}"

This works, but I'm not sure how to add it to a list.  I'm doing this on 
localhost for how to get the idea solid, then I should be able to run it on 
other hosts.  Any ideas on how to accomplish this?

Thanks,
Harry

-- 
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/ddef7136-4919-4082-a7e9-f4a6e1fb9751%40googlegroups.com.


[ansible-project] Re: ansible add esxi host to datacenter or folder

2020-04-13 Thread David Foley
Hi Tony,

Looking at the Documentation 
https://docs.ansible.com/ansible/latest/modules/vmware_host_module.html

- name: Add ESXi Host to vCenter
  vmware_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: datacenter_name
cluster: cluster_name
esxi_hostname: '{{ esxi_hostname }}'
esxi_username: '{{ esxi_username }}'
esxi_password: '{{ esxi_password }}'
state: present
  delegate_to: localhost

This code will add the host to a Cluster, 


On Monday, April 13, 2020 at 4:48:40 PM UTC+1, Tony Wong wrote:
>
> I am new to ansible and want to know how to add a esxi host to vcenter in 
> a datacenter
>
> I have the following in a yml file but not sure what else to do
>
>
> - hosts: localhost
>   connection: local
>   tasks:
> - name: include vars
>   include_vars:
>
> - name: Add ESXi Host to vCenter
>   vmware_host:
> hostname: '{{ vcenter_hostname }}'
> username: '{{ vcenter_username }}'
> password: '{{ vcenter_password }}'
> datacenter: datacenter_name
> esxi_hostname: '{{ esxi_hostname }}'
> esxi_username: '{{ esxi_username }}'
> esxi_password: '{{ esxi_password }}'
> state: present
>   delegate_to: localhost
> ~
>
>
>
>
> please help as vmware ansible seems very limited in info 
>

-- 
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/7d76788c-cc3f-4530-80cd-626b4700cf1c%40googlegroups.com.


[ansible-project] Re: ansible updating vmware tools on windows vms

2020-04-13 Thread David Foley
I have supplied a completed Playbook for you to use ? what else are you 
looking for ? 


On Sunday, April 12, 2020 at 11:20:26 PM UTC+1, Tony Wong wrote:
>
> I created a yml file like this. I just need to test it on one vm. 
>
> ---
> - hosts all
>   gather_facts: false
>   connection: local
>   user: remote
>
>   vars:
> vcenter_hostname: 'vcenter.domain.com'
> username: 'administrator@vsphere.local'
> password: ''
> datacenter_name: 'DC1'
> VM_Name: 'vm1'
>
> - name: Running VMTools Playbook
>   hosts: localhost
>   gather_facts: false
>   connection: local
>   tasks:
>   - name: Get Virtual Machine info
> vmware_guest_info:
>   validate_certs: no
>   hostname: "{{ vcenter_hostname }}"
>   username: "{{ user }}"
>   password:  "{{ pass }}"
>   validate_certs: no
>   datacenter: "{{ datacenter_name }}"
>   name: "{{ VM_Name }}"
>   schema: "vsphere"
>   properties:
> delegate_to: localhost
> register: vminfo
>
>   - name: Updating VM Tools
> vmware_guest_tools_upgrade:
>   validate_certs: no
>   hostname: "{{ vcenter_hostname }}"
>   username: "{{ user }}"
>   password: "{{ pass }}"
>   datacenter: "{{ datacenter_name }}"
>   uuid: "{{ vminfo.instance.config.uuid }}"
> delegate_to: localhost
>
>
>
> what else do i need?
>
> On Sunday, April 12, 2020 at 10:16:23 AM UTC-7, Tony Wong wrote:
>>
>> does anyone have a playbook or how do i get started with a playbook 
>> updating vmwasr tools on windows guests?
>>
>

-- 
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/d2519fad-602f-4502-a4f2-5478fb110f2e%40googlegroups.com.


[ansible-project] ansible add esxi host to datacenter or folder

2020-04-13 Thread Tony Wong
I am new to ansible and want to know how to add a esxi host to vcenter in a 
datacenter

I have the following in a yml file but not sure what else to do


- hosts: localhost
  connection: local
  tasks:
- name: include vars
  include_vars:

- name: Add ESXi Host to vCenter
  vmware_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: datacenter_name
esxi_hostname: '{{ esxi_hostname }}'
esxi_username: '{{ esxi_username }}'
esxi_password: '{{ esxi_password }}'
state: present
  delegate_to: localhost
~




please help as vmware ansible seems very limited in info 

-- 
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/e67f9df7-418d-4e35-8910-308b4435ec62%40googlegroups.com.


Re: [ansible-project] telnet issue

2020-04-13 Thread Zaldy B
Gettign this logs:

host_list declined parsing /etc/ansible/TEMPLATES/Cisco_Telnet as it did 
not pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the 
current user



On Monday, April 13, 2020 at 4:37:13 AM UTC-4, Zaldy B wrote:
>
> Hi Srinivas,
>
> Sure! I will update you.
>
> This is just weird, I tried it on GNS3 and it is working. but on the prod 
> itself, it is not. 
>
> playbook is just straight forward:
>
>
> ---
> - name: Telnet do show version for IOS
>   hosts: Cisco_Telnet
>   gather_facts: false
>   connection: local
>
>   tasks:
> - name: show version
>   telnet:
> user: "{{ username }}"
> password: "{{ password }}"
> login_prompt: "Username:"
> prompts:
>   - "[>|#]"
> command:
>   - terminal length 0
>   - show version
>
>
> hostfile:
>
> [Cisco_Telnet]
> cisco_devicehost=192.168.1.1   username=cisco password=cisco
>
>
> On Monday, April 13, 2020 at 4:27:20 AM UTC-4, Srinivas Naram wrote:
>>
>> Some time back just to test telnet module, I tried telnet for devices 
>> which had ssh as well as telnet access. However I was not successful and 
>> gave up. If you get this working, kindly reply with the solution.
>>
>> Thanks
>> Srinivas. 
>>
>> On Mon, Apr 13, 2020 at 1:44 PM Zaldy B  wrote:
>>
>>> Hi Karl,
>>>
>>> Unfortunately, those devices that we have are old and uses telnet :)  
>>>
>>> But other devices which are SSH enabled are being automated by ansible 
>>>
>>> On Monday, April 13, 2020 at 4:05:53 AM UTC-4, Karl Auer wrote:

 Unless you have some specific reason for wanting to use telnet, the 
 obvious workaround is to use ssh instead

 Regards, K.


 On Mon, Apr 13, 2020 at 5:51 PM Zaldy B  wrote:

> Hi Karl,
>
> yes, I can connect to the device from my ansible server using telnet.  
> I can also connect to the device using my putty (outside of ansible) 
> using 
> telnet.
>
>
>
> On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>>
>> Can you connect to your IOS devices normally, i.e. outside Ansible?
>>
>> If yes, then I have no idea what's going on, but if not, get that 
>> working first before you try doing it with Ansible.
>>
>> Off the cuff theory is that the devices do not permit telnet 
>> connections...
>>
>> Regards, K.
>>
>>
>> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:
>>
>>> Hi Experts,
>>>
>>> I am just new with this one. I am trying to connect using telnet 
>>> (ssh has no issue) to my IOS devices, but I am getting error when I run 
>>> my 
>>> playbook:
>>> --
>>>
>>>- 
>>>
>>>name: Telnet do show version for IOS
>>>hosts: telnet_device
>>>gather_facts: false
>>>connection: local
>>>
>>>tasks:
>>>- name: show version
>>>   telnet:
>>>   user: cisco
>>>   password: cisco
>>>   login_prompt: "Username: "
>>>   prompts:
>>>   - "[>#]"
>>>   command:
>>>   - terminal length 0
>>>   - show version
>>>
>>> Error:
>>> PLAY [Telnet do show version for IOS] 
>>> ***
>>>
>>> TASK [show version] 
>>> *
>>> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet 
>>> action failed: telnet connection closed", "output": []}
>>>
>>> PLAY RECAP 
>>> **
>>> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 
>>> rescued=0 ignored=0
>>>
>>>
>>>
>>> Any suggestions/comments is much 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>>
>> *Karl Auer* { manager, systems support }
>> P: 1300 759 975
>> E: ka...@2pisoftware.com
>> 2pisoftware.com
>>
>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107

[ansible-project] Need some suggestion

2020-04-13 Thread Rahul Kumar
Hi Ansible Gurus,
I need some help for some framework designing based on Ansible. I have many
components and i have maintained ansible role for each component deployment
in common project.
Means all components installation/configuration managed by that common
project .

I wanted to bring a framework , that rather than keep all component roles
in a single common project , distribute each component
installation/configuration (role) to individual component git repos, so
that whenever component changes its actual application code base, it can
change corresponding Ansible code also in same repo if required.
So common project (a big molecule) will be spilitted  and still some common
operations/cross cutting features  i want to maintain in common project
only which can be applied on all components.

So i need some kind of Interface between common project Ansible code and
all other components ansible codes.

How can i achieve this ?
Any suggestion is welcomed, its more like a design problem if one wants to
manage multiple component installation/configuration . So which is better
approach
1. Maintaining all components installation/configuration Ansible roles in
single project
2. Have only common cross cutting operations in single or common project
and distribute component specific code to individual component code repo
and then interface between Common project Ansible code and individual
component ansible code some how.

Did anyone came across such design problems ?

Regards
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/CAGH8rEwRgEYge1cRBGZGJ2-Qv9wYfe9c0A4TYaonKxMrkBtCQA%40mail.gmail.com.


[ansible-project] Re: strategy=free with adhoc?

2020-04-13 Thread Dick Visser
prefixing the whole adhoc line with "ANSIBLE_STRATEGY=free" does the trick!

On Mon, 13 Apr 2020 at 12:46, Dick Visser  wrote:
>
> Hi
>
> For simple fire & forget commands with ansible there is no requirement
> to go over the hosts sequentially. Ideally i'd use strategy=free - but
> that doesn't seem to be possible with ansible, only with
> ansible-playbook?
> Any other way to achieve this?
>
> thx
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT



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


[ansible-project] Problem Role Mysql

2020-04-13 Thread marckson junior
Hi guys,

Im having a problem when i run one playbook with my role to install and
create a database inside mysql.

The first time i run the playbook it finishes successfully.
But when i run again i get an error saying ansible canot connect to my
database.
although i can connect the database manually without a problem using my
.my.cnf file where is my root password.

This is my role Mysql:

---

- name: Instalacao de Pacotes
  yum:
name: [ 'mariadb-server', 'python3-PyMySQL' ]
state: latest

- name: Criação da senha de root
  command: openssl rand -base64 14 creates=/root/.my.cnf
  register: mysql_root_pass

- name: Display password
  debug:
   msg: "Password: {{ mysql_root_pass.stdout }}"
  when:
- mysql_root_pass.changed

- name: Start Mysql
  systemd:
name: mariadb
enabled: true
state: restarted

- name: Alterar a senha de root
  mysql_user:
name: root
host: localhost
password: "{{ mysql_root_pass.stdout }}"
  when:
- mysql_root_pass.changed

- name: Copiando template .my.cnf
  template: src=.my.cnf dest=/root/.my.cnf owner=root group=root mode='600'
  when:
  - mysql_root_pass.changed
  notify:
-  Restart MariaDB
- name: Removendo o acesso Anonimo
  mysql_user: name="" host=localhost state=absent

- name: Removendo a base test
  mysql_db: name=test state=absent

- name: Criação da base de dados Wordpress
  mysql_db:
name: 'wordpress'
state: present
login_user: 'root'
login_password: "{{ mysql_root_pass.stdout }}"
login_host: 'localhost'
login_unix_socket: /var/lib/mysql/mysql.sock

- name: Criação do usuario Wordpress e liberaçao de acessoa  base de dados
Wordpress.
  mysql_user:
name: 'wordpress'
password: 'wordpress'
priv: 'wordpress.*:ALL'
host: '10.0.2.%'
login_user: 'root'
login_password: "{{ mysql_root_pass.stdout }}"
login_host: 'localhost'


As i said, the first time i run, i got no problems:

TASK [mysql : Criação da base de dados Wordpress]
**
22:29:49
43
changed: [wordpress.juin.com]
44
44


But the second time, i thin i shoud receive a green "OK" because my
database is already created but i get that:

TASK [mysql : Criação da base de dados Wordpress]
**
22:32:12
34
fatal: [wordpress.juin.com]: FAILED! => {"changed": false, "msg": "unable
to connect to database, check login_user and login_password are correct or
/root/.my.cnf has the credentials. Exception message: (1045, \"Access
denied for user 'root'@'localhost' (using password: YES)\")"}
...

Can you help me resolve this?


-- 
Marckson Negreiros Junior

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


[ansible-project] strategy=free with adhoc?

2020-04-13 Thread Dick Visser
Hi

For simple fire & forget commands with ansible there is no requirement
to go over the hosts sequentially. Ideally i'd use strategy=free - but
that doesn't seem to be possible with ansible, only with
ansible-playbook?
Any other way to achieve this?

thx

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


Re: [ansible-project] Ansible netconf module supporting netconf notifications

2020-04-13 Thread Senthil Jayakumar
Hi Ganesh,

Thanks for the reply.

When you say, we can subscribe to the notification using Ansible and not
processing meaning there is no library available for processing? If
required, the Ansible can parse the interested notifications e.g. for
knowing status of the command execution or state information.

In this case, I wanted to parse the status of download to know if it is
really completed or not. So, it is not feasible through anisble?

Please clarify.

*Download Notification*

2018-12-18T06:52:37Z

image-x86-64-1.0.0.tgz
COMPLETED




Thanks,
Senthil Kumar Jayakumar

On Mon, Apr 13, 2020 at 10:45 AM Ganesh Nalawade 
wrote:

>
> You can use netconf_rpc module to create netconf subscription using
> Ansible, processing notification is not supported with Ansible.
>
> On Sun, Apr 12, 2020 at 8:05 PM Senthil Jayakumar <
> senthil.jayaku...@gmail.com> wrote:
>
>> Hi There,
>>
>> I appreciate if the excerpts could respond to this query.
>>
>> Thanks,
>> Senthil Kumar Jayakumar
>>
>> On Thu, Apr 9, 2020 at 5:19 PM Senthil Jayakumar <
>> senthil.jayaku...@gmail.com> wrote:
>>
>>> Hi There,
>>>
>>> I'm newbie to Ansible and would like to know if Ansible netconf module
>>> supports subscribing and processing of netconf notifications?
>>>
>>> Please confirm and redirect me to appropriate documentation and samples.
>>>
>>> Thanks,
>>> Senthil Kumar Jayakumar
>>>
>>> --
>>> 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/cb5f5fd8-de81-42f6-aebc-f4d4e15090bd%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/CAD9Vb1yCJFHcBc0A7m1V1tvimkbPkOpWGumwuOCh30%3Dvea8%2Bzg%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Regards,
> Ganesh B. Nalawade
>
>
> --
> 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/CA%2B6y2sEiu357ms8AqZC1RUeGOpDKkYM0tdrDCjDu7z-Hoh8Trg%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/CAD9Vb1xMrkbrQhPLDKHR7deNWiv8hZj%3DZjpx07xk_Ua7khJ_OA%40mail.gmail.com.


Re: [ansible-project] telnet issue

2020-04-13 Thread Zaldy B
Hi Srinivas,

Sure! I will update you.

This is just weird, I tried it on GNS3 and it is working. but on the prod 
itself, it is not. 

playbook is just straight forward:


---
- name: Telnet do show version for IOS
  hosts: Cisco_Telnet
  gather_facts: false
  connection: local

  tasks:
- name: show version
  telnet:
user: "{{ username }}"
password: "{{ password }}"
login_prompt: "Username:"
prompts:
  - "[>|#]"
command:
  - terminal length 0
  - show version


hostfile:

[Cisco_Telnet]
cisco_devicehost=192.168.1.1   username=cisco password=cisco


On Monday, April 13, 2020 at 4:27:20 AM UTC-4, Srinivas Naram wrote:
>
> Some time back just to test telnet module, I tried telnet for devices 
> which had ssh as well as telnet access. However I was not successful and 
> gave up. If you get this working, kindly reply with the solution.
>
> Thanks
> Srinivas. 
>
> On Mon, Apr 13, 2020 at 1:44 PM Zaldy B > 
> wrote:
>
>> Hi Karl,
>>
>> Unfortunately, those devices that we have are old and uses telnet :)  
>>
>> But other devices which are SSH enabled are being automated by ansible 
>>
>> On Monday, April 13, 2020 at 4:05:53 AM UTC-4, Karl Auer wrote:
>>>
>>> Unless you have some specific reason for wanting to use telnet, the 
>>> obvious workaround is to use ssh instead
>>>
>>> Regards, K.
>>>
>>>
>>> On Mon, Apr 13, 2020 at 5:51 PM Zaldy B  wrote:
>>>
 Hi Karl,

 yes, I can connect to the device from my ansible server using telnet.  
 I can also connect to the device using my putty (outside of ansible) using 
 telnet.



 On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>
> Can you connect to your IOS devices normally, i.e. outside Ansible?
>
> If yes, then I have no idea what's going on, but if not, get that 
> working first before you try doing it with Ansible.
>
> Off the cuff theory is that the devices do not permit telnet 
> connections...
>
> Regards, K.
>
>
> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:
>
>> Hi Experts,
>>
>> I am just new with this one. I am trying to connect using telnet (ssh 
>> has no issue) to my IOS devices, but I am getting error when I run my 
>> playbook:
>> --
>>
>>- 
>>
>>name: Telnet do show version for IOS
>>hosts: telnet_device
>>gather_facts: false
>>connection: local
>>
>>tasks:
>>- name: show version
>>   telnet:
>>   user: cisco
>>   password: cisco
>>   login_prompt: "Username: "
>>   prompts:
>>   - "[>#]"
>>   command:
>>   - terminal length 0
>>   - show version
>>
>> Error:
>> PLAY [Telnet do show version for IOS] 
>> ***
>>
>> TASK [show version] 
>> *
>> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet 
>> action failed: telnet connection closed", "output": []}
>>
>> PLAY RECAP 
>> **
>> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 
>> rescued=0 ignored=0
>>
>>
>>
>> Any suggestions/comments is much 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> *Karl Auer* { manager, systems support }
> P: 1300 759 975
> E: ka...@2pisoftware.com
> 2pisoftware.com
>
> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>
 -- 
 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/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com
  

Re: [ansible-project] telnet issue

2020-04-13 Thread Srinivas Naram
Some time back just to test telnet module, I tried telnet for devices which
had ssh as well as telnet access. However I was not successful and gave up.
If you get this working, kindly reply with the solution.

Thanks
Srinivas.

On Mon, Apr 13, 2020 at 1:44 PM Zaldy B  wrote:

> Hi Karl,
>
> Unfortunately, those devices that we have are old and uses telnet :)
>
> But other devices which are SSH enabled are being automated by ansible
>
> On Monday, April 13, 2020 at 4:05:53 AM UTC-4, Karl Auer wrote:
>>
>> Unless you have some specific reason for wanting to use telnet, the
>> obvious workaround is to use ssh instead
>>
>> Regards, K.
>>
>>
>> On Mon, Apr 13, 2020 at 5:51 PM Zaldy B  wrote:
>>
>>> Hi Karl,
>>>
>>> yes, I can connect to the device from my ansible server using telnet.  I
>>> can also connect to the device using my putty (outside of ansible) using
>>> telnet.
>>>
>>>
>>>
>>> On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:

 Can you connect to your IOS devices normally, i.e. outside Ansible?

 If yes, then I have no idea what's going on, but if not, get that
 working first before you try doing it with Ansible.

 Off the cuff theory is that the devices do not permit telnet
 connections...

 Regards, K.


 On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:

> Hi Experts,
>
> I am just new with this one. I am trying to connect using telnet (ssh
> has no issue) to my IOS devices, but I am getting error when I run my
> playbook:
> --
>
>-
>
>name: Telnet do show version for IOS
>hosts: telnet_device
>gather_facts: false
>connection: local
>
>tasks:
>- name: show version
>   telnet:
>   user: cisco
>   password: cisco
>   login_prompt: "Username: "
>   prompts:
>   - "[>#]"
>   command:
>   - terminal length 0
>   - show version
>
> Error:
> PLAY [Telnet do show version for IOS]
> ***
>
> TASK [show version]
> *
> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet
> action failed: telnet connection closed", "output": []}
>
> PLAY RECAP
> **
> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0
> rescued=0 ignored=0
>
>
>
> Any suggestions/comments is much 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
> 
> .
>


 --

 *Karl Auer* { manager, systems support }
 P: 1300 759 975
 E: ka...@2pisoftware.com
 2pisoftware.com

 GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
 Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E

>>> --
>>> 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/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> *Karl Auer* { manager, systems support }
>> P: 1300 759 975
>> E: ka...@2pisoftware.com
>> 2pisoftware.com
>>
>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
>> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>>
> --
> 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/6c9852f6-30a6-4326-b29a-d2d354a947f8%40googlegroups.com
> 

Re: [ansible-project] telnet issue

2020-04-13 Thread Zaldy B
Hi Karl,

Unfortunately, those devices that we have are old and uses telnet :)  

But other devices which are SSH enabled are being automated by ansible 

On Monday, April 13, 2020 at 4:05:53 AM UTC-4, Karl Auer wrote:
>
> Unless you have some specific reason for wanting to use telnet, the 
> obvious workaround is to use ssh instead
>
> Regards, K.
>
>
> On Mon, Apr 13, 2020 at 5:51 PM Zaldy B > 
> wrote:
>
>> Hi Karl,
>>
>> yes, I can connect to the device from my ansible server using telnet.  I 
>> can also connect to the device using my putty (outside of ansible) using 
>> telnet.
>>
>>
>>
>> On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>>>
>>> Can you connect to your IOS devices normally, i.e. outside Ansible?
>>>
>>> If yes, then I have no idea what's going on, but if not, get that 
>>> working first before you try doing it with Ansible.
>>>
>>> Off the cuff theory is that the devices do not permit telnet 
>>> connections...
>>>
>>> Regards, K.
>>>
>>>
>>> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:
>>>
 Hi Experts,

 I am just new with this one. I am trying to connect using telnet (ssh 
 has no issue) to my IOS devices, but I am getting error when I run my 
 playbook:
 --

- 

name: Telnet do show version for IOS
hosts: telnet_device
gather_facts: false
connection: local

tasks:
- name: show version
   telnet:
   user: cisco
   password: cisco
   login_prompt: "Username: "
   prompts:
   - "[>#]"
   command:
   - terminal length 0
   - show version

 Error:
 PLAY [Telnet do show version for IOS] 
 ***

 TASK [show version] 
 *
 fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet 
 action failed: telnet connection closed", "output": []}

 PLAY RECAP 
 **
 telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 
 rescued=0 ignored=0



 Any suggestions/comments is much 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>>
>>> *Karl Auer* { manager, systems support }
>>> P: 1300 759 975
>>> E: ka...@2pisoftware.com
>>> 2pisoftware.com
>>>
>>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
>>> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>>>
>> -- 
>> 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/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> *Karl Auer* { manager, systems support }
> P: 1300 759 975
> E: ka...@2pisoftware.com 
> 2pisoftware.com
>
> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>

-- 
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/6c9852f6-30a6-4326-b29a-d2d354a947f8%40googlegroups.com.


Re: [ansible-project] telnet issue

2020-04-13 Thread Karl Auer
Unless you have some specific reason for wanting to use telnet, the obvious
workaround is to use ssh instead

Regards, K.


On Mon, Apr 13, 2020 at 5:51 PM Zaldy B  wrote:

> Hi Karl,
>
> yes, I can connect to the device from my ansible server using telnet.  I
> can also connect to the device using my putty (outside of ansible) using
> telnet.
>
>
>
> On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>>
>> Can you connect to your IOS devices normally, i.e. outside Ansible?
>>
>> If yes, then I have no idea what's going on, but if not, get that working
>> first before you try doing it with Ansible.
>>
>> Off the cuff theory is that the devices do not permit telnet
>> connections...
>>
>> Regards, K.
>>
>>
>> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:
>>
>>> Hi Experts,
>>>
>>> I am just new with this one. I am trying to connect using telnet (ssh
>>> has no issue) to my IOS devices, but I am getting error when I run my
>>> playbook:
>>> --
>>>
>>>-
>>>
>>>name: Telnet do show version for IOS
>>>hosts: telnet_device
>>>gather_facts: false
>>>connection: local
>>>
>>>tasks:
>>>- name: show version
>>>   telnet:
>>>   user: cisco
>>>   password: cisco
>>>   login_prompt: "Username: "
>>>   prompts:
>>>   - "[>#]"
>>>   command:
>>>   - terminal length 0
>>>   - show version
>>>
>>> Error:
>>> PLAY [Telnet do show version for IOS]
>>> ***
>>>
>>> TASK [show version]
>>> *
>>> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet
>>> action failed: telnet connection closed", "output": []}
>>>
>>> PLAY RECAP
>>> **
>>> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0
>>> rescued=0 ignored=0
>>>
>>>
>>>
>>> Any suggestions/comments is much 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> *Karl Auer* { manager, systems support }
>> P: 1300 759 975
>> E: ka...@2pisoftware.com
>> 2pisoftware.com
>>
>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
>> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>>
> --
> 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/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com
> 
> .
>


-- 

*Karl Auer* { manager, systems support }
P: 1300 759 975
E: ka...@2pisoftware.com
2pisoftware.com

GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E

-- 
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/CA%2B%2BT08TUa3W5ge7VsP%2BgtL0ciq%3DJMSNDMsbrZbpn48quZCVpeQ%40mail.gmail.com.


[ansible-project] Re: telnet issue

2020-04-13 Thread Zaldy B
I am getting this error:

FAILED! => {"changed": true, "msg": "Telnet action failed: telnet 
connection closed", "output": []}



On Monday, April 13, 2020 at 3:07:25 AM UTC-4, Zaldy B wrote:
>
> Hi Experts,
>
> I am just new with this one. I am trying to connect using telnet (ssh has 
> no issue) to my IOS devices, but I am getting error when I run my playbook:
> --
>
>- 
>
>name: Telnet do show version for IOS
>hosts: telnet_device
>gather_facts: false
>connection: local
>
>tasks:
>- name: show version
>   telnet:
>   user: cisco
>   password: cisco
>   login_prompt: "Username: "
>   prompts:
>   - "[>#]"
>   command:
>   - terminal length 0
>   - show version
>
> Error:
> PLAY [Telnet do show version for IOS] 
> ***
>
> TASK [show version] 
> *
> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet action 
> failed: telnet connection closed", "output": []}
>
> PLAY RECAP 
> **
> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 
> ignored=0
>
>
>
> Any suggestions/comments is much 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/d249cf6f-c1ad-4e21-915e-d7190264ebbb%40googlegroups.com.


Re: [ansible-project] telnet issue

2020-04-13 Thread Zaldy B
Hi Karl,

yes, I can connect to the device from my ansible server using telnet.  I 
can also connect to the device using my putty (outside of ansible) using 
telnet.



On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>
> Can you connect to your IOS devices normally, i.e. outside Ansible?
>
> If yes, then I have no idea what's going on, but if not, get that working 
> first before you try doing it with Ansible.
>
> Off the cuff theory is that the devices do not permit telnet connections...
>
> Regards, K.
>
>
> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B > 
> wrote:
>
>> Hi Experts,
>>
>> I am just new with this one. I am trying to connect using telnet (ssh has 
>> no issue) to my IOS devices, but I am getting error when I run my playbook:
>> --
>>
>>- 
>>
>>name: Telnet do show version for IOS
>>hosts: telnet_device
>>gather_facts: false
>>connection: local
>>
>>tasks:
>>- name: show version
>>   telnet:
>>   user: cisco
>>   password: cisco
>>   login_prompt: "Username: "
>>   prompts:
>>   - "[>#]"
>>   command:
>>   - terminal length 0
>>   - show version
>>
>> Error:
>> PLAY [Telnet do show version for IOS] 
>> ***
>>
>> TASK [show version] 
>> *
>> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet 
>> action failed: telnet connection closed", "output": []}
>>
>> PLAY RECAP 
>> **
>> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 
>> ignored=0
>>
>>
>>
>> Any suggestions/comments is much 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> *Karl Auer* { manager, systems support }
> P: 1300 759 975
> E: ka...@2pisoftware.com 
> 2pisoftware.com
>
> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>

-- 
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/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com.


Re: [ansible-project] telnet issue

2020-04-13 Thread Karl Auer
Can you connect to your IOS devices normally, i.e. outside Ansible?

If yes, then I have no idea what's going on, but if not, get that working
first before you try doing it with Ansible.

Off the cuff theory is that the devices do not permit telnet connections...

Regards, K.


On Mon, Apr 13, 2020 at 5:07 PM Zaldy B  wrote:

> Hi Experts,
>
> I am just new with this one. I am trying to connect using telnet (ssh has
> no issue) to my IOS devices, but I am getting error when I run my playbook:
> --
>
>-
>
>name: Telnet do show version for IOS
>hosts: telnet_device
>gather_facts: false
>connection: local
>
>tasks:
>- name: show version
>   telnet:
>   user: cisco
>   password: cisco
>   login_prompt: "Username: "
>   prompts:
>   - "[>#]"
>   command:
>   - terminal length 0
>   - show version
>
> Error:
> PLAY [Telnet do show version for IOS]
> ***
>
> TASK [show version]
> *
> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet action
> failed: telnet connection closed", "output": []}
>
> PLAY RECAP
> **
> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0
> ignored=0
>
>
>
> Any suggestions/comments is much 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/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
> 
> .
>


-- 

*Karl Auer* { manager, systems support }
P: 1300 759 975
E: ka...@2pisoftware.com
2pisoftware.com

GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E

-- 
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/CA%2B%2BT08R-n_mPcN1H_B8WtbYUakJ-daszsA4v7BnztF0WFH0dRA%40mail.gmail.com.


Re: [ansible-project] Change hosts variable when including another playbook

2020-04-13 Thread Aditya Garg
What will be the command to pass username and password for both the host 
considering none of the host is localhost.

On Saturday, September 24, 2016 at 8:58:31 AM UTC+5:30, Brian Coca wrote:
>
> A playbook can have multiple plays:
>
> - hosts: host_for_play_1
>   tasks:
>- debug: msg='play 1 task'
> ​
> ​...
>
> ​
> ​- hosts: host_for_play_2
>   tasks:
>- debug: msg='play 2 task'​
> 
>
>
> --
> 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/b48fe0dc-a278-4d6d-b475-80e9a81ed96d%40googlegroups.com.


[ansible-project] Re: telnet issue

2020-04-13 Thread Zaldy B
I am getting this when I do -vvv


ansible-playbook 2.8.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not 
pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the 
current user
script declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not pass 
it's verify_file() method
auto declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not pass 
it's verify_file() method
Skipping due to inventory source not existing or not being readable by the 
current user
yaml declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not pass 
it's verify_file() method
Skipping due to inventory source not existing or not being readable by the 
current user
ini declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not pass 
it's verify_file() method
Skipping due to inventory source not existing or not being readable by the 
current user
toml declined parsing /etc/ansible/TEMPLATES/Cisco_IOS as it did not pass 
it's verify_file() method
 [WARNING]: Unable to parse /etc/ansible/TEMPLATES/Cisco_IOS as an 
inventory source
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note 
that the implicit localhost does not match 'all'




On Monday, April 13, 2020 at 3:07:25 AM UTC-4, Zaldy B wrote:
>
> Hi Experts,
>
> I am just new with this one. I am trying to connect using telnet (ssh has 
> no issue) to my IOS devices, but I am getting error when I run my playbook:
> --
>
>- 
>
>name: Telnet do show version for IOS
>hosts: telnet_device
>gather_facts: false
>connection: local
>
>tasks:
>- name: show version
>   telnet:
>   user: cisco
>   password: cisco
>   login_prompt: "Username: "
>   prompts:
>   - "[>#]"
>   command:
>   - terminal length 0
>   - show version
>
> Error:
> PLAY [Telnet do show version for IOS] 
> ***
>
> TASK [show version] 
> *
> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet action 
> failed: telnet connection closed", "output": []}
>
> PLAY RECAP 
> **
> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 
> ignored=0
>
>
>
> Any suggestions/comments is much 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/696fa729-3a94-4ac7-9086-1349a9316d8d%40googlegroups.com.


[ansible-project] telnet issue

2020-04-13 Thread Zaldy B


Hi Experts,

I am just new with this one. I am trying to connect using telnet (ssh has 
no issue) to my IOS devices, but I am getting error when I run my playbook:
--

   - 
   
   name: Telnet do show version for IOS
   hosts: telnet_device
   gather_facts: false
   connection: local
   
   tasks:
   - name: show version
  telnet:
  user: cisco
  password: cisco
  login_prompt: "Username: "
  prompts:
  - "[>#]"
  command:
  - terminal length 0
  - show version
   
Error:
PLAY [Telnet do show version for IOS] 
***

TASK [show version] 
*
fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet action 
failed: telnet connection closed", "output": []}

PLAY RECAP 
**
telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 
ignored=0



Any suggestions/comments is much 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/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com.