Re: [ansible-project] How to send ansible tower metrics to prometheus

2021-04-19 Thread Phil Griffiths
Hi Ankit

There should be a register option as well? If you use that you get access
to the full back catalogue of recordings as well as mine.

Regards
Phil.

On Mon, 22 Mar 2021 at 18:07, phil.gr...@gmail.com 
wrote:

> You don't need a script this can all be done with Ansible - you should be
> able to replay the session I recorded for
> https://events.redhat.com/profile/form/index.cfm?PKformID=0x183978abcd
> "*Hello Ansible Tower! - How's Your Health?"*
>
> On Monday, 22 March 2021 at 05:14:19 UTC Ankit wrote:
>
>> Hello,
>>
>> I don't have a playook however, if you want to collect and send the
>> metrics from tower/awx, you might have to write a script for that. Please
>> also see if the external logging is helpful.
>>
>> On Mon, Mar 22, 2021, 1:14 AM Saravanan Ponnusamy 
>> wrote:
>>
>>> Hi Ankit,
>>> Thanks for sharing the details. Do you have a sample Ansible playbook to
>>> connect to the Prometheus?
>>>
>>> Regards
>>> Saravanan
>>>
>>>
>>> On Mon, Mar 8, 2021 at 1:37 AM Ankit Vashistha 
>>> wrote:
>>>
 Hello,

 Check this: 12. Metrics — Ansible Tower Administration Guide v3.8.1
 

 *Regards,*
 *Ankit*


 On Thu, Mar 4, 2021 at 1:22 AM Saravanan Ponnusamy 
 wrote:

> Hi Ansible experts,
> We are trying to push Ansible metrics to Prometheus and create a
> Grafana dashboard.
> Can you please provide a sample playbook/ note to hook up Ansible
> metrics to Prometheus?
>
> Regards
> Saravanan
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAMLxZaNmUHQ-%2B104uZ5Q9BoUZvghGq-YEm%2BoTt2%2Bz8LQZSkXNQ%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-proje...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CACecUhudHMwimbD7eLccU5VyGL0ksgj2oLrfaYsLDRh6ZK%3DCDA%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-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CAMLxZaOp-5UwsHLGEzLmgtuMU2r%3DQgm1xN6Tb-LTiVrvwjbaDQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> 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/VBOdbWcei_Q/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/526d6c03-673e-4ddb-824f-76f8406c945bn%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/CAJ3TUwijkym%3DbM_xK5womFX3A_R4O%2BZYkpXvMD-dmfoMzEF_PA%40mail.gmail.com.


Re: [ansible-project] Re: Command Not found but module is installed

2020-10-23 Thread Phil Griffiths
Hummm. I suggest you try the same mechanism with 1) a different module from
the same collection and 2) a different collection

On Fri, 23 Oct 2020 at 17:56, Fiend Busa  wrote:

> Im still getting the same error :(
>
> ERROR! couldn't resolve module/action 'arubaoss_command'. This often
> indicates a misspelling, missing collection, or incorrect module path.
>
> in my github I have a file named requirements.yml
>
> ---
>
> collections:
>
>
> - name: arubanetworks.aos_switch
>
> source: https://galaxy.ansible.com
>
> Then I have a playbook:
>
>
> ---
>
> - hosts: all
>
> gather_facts: false
>
> connection: localhost
>
>
>
> collections:
>
> - arubanetworks.aos_switch
>
>
>
> tasks:
>
> - name: Execute show run on the switch
>
> arubanetworks.aos_switch.arubaoss_command:
>
> commands: ['sh run']
>
> On Friday, October 23, 2020 at 12:25:21 PM UTC-4 Fiend Busa wrote:
>
>> :O
>>
>> Sorry haha, I will try that, fingers crossed!
>>
>> On Friday, October 23, 2020 at 11:15:38 AM UTC-4 phil.gr...@gmail.com
>> wrote:
>>
>>> Yes that'll make all the difference! You should have logged this issue
>>> against the awx group and given the full info upfront, so we could get to
>>> this point a lot quicker!
>>> You don't need to install that collection locally first when using with
>>> awx. Just drop a requirements.yml file into a repo with your playbooks so
>>> AWX can pick it up and do the install in the right place for you. See my
>>> example here: https://github.com/ffirg/tower_collection_example You
>>> might need to setup the creds for Galaxy in AWX as well so it can
>>> authenticate and do the install.
>>>
>>> On Friday, 23 October 2020 at 14:57:43 UTC+1 ggil...@gmail.com wrote:
>>>
 Im running ansible through AWX if that makes a difference.

 On Friday, October 23, 2020 at 9:56:21 AM UTC-4 Fiend Busa wrote:

> I tried updating ansible but it keeps installing version 2.9.6 every
> time and not 2.10
>
> As for ansible-doc -l | grep aruba
>
> I get the following:
>
> aruba_command
> aruba_config
> aruba_module_installer
> On Thursday, October 22, 2020 at 4:09:45 PM UTC-4 phil.gr...@gmail.com
> wrote:
>
>> Check file permissions?
>> Also try ansible-doc -l | grep aruba to see if it can find those
>> modules
>>
>> On Thu, 22 Oct 2020 at 18:10, Fiend Busa  wrote:
>>
>>> Hey,
>>>
>>> Mine are all under:  ~/.ansible/collections/ansible_collections
>>>
>>> ls -all in this directory gives me
>>>
>>> ansible
>>> arubanetworks
>>> check_point
>>> cisco
>>> community
>>> fortinet
>>>
>>> On Thursday, October 22, 2020 at 10:52:22 AM UTC-4
>>> phil.gr...@gmail.com wrote:
>>>
 what does 'ansible-galaxy collection list' output? mine are under
 ~/.ansible/collections/ansible_collections
 what ansible version you on?

 I'm not convinced that collection is complete as some of those
 modules don't have docs that render for me using ansible-doc

 On Thu, 22 Oct 2020 at 15:10, Fiend Busa  wrote:

>
> I can see
> ~./.ansible/collections/arubanetworks/aos_switch/plugins/modules/arubaoss_command.py
> On Thursday, October 22, 2020 at 9:48:23 AM UTC-4 Fiend Busa wrote:
>
>> Hey,
>>
>> So all the collections are being installed in ~/.*ansible*/
>> *collections*/
>>
>> ansible CFG is located in /etc/ansible.cfg
>>
>> I have other collections as well (cisco.asa) it's only the aruba
>> one that is giving this error. I installed the collection directly 
>> on the
>> ubuntu server and can see it under ~/.*ansible*/*collections*/
>> On Wednesday, October 21, 2020 at 4:16:08 PM UTC-4
>> phil.gr...@gmail.com wrote:
>>
>>> Ok, so this is suggesting that it can't find it on the default
>>> collections path to me. Do you have an ansible.cfg with anything in 
>>> it for
>>> collections and where did you install the collection?
>>>
>>> On Wed, 21 Oct 2020 at 21:10, Fiend Busa 
>>> wrote:
>>>
 Hey,

 I get the same error:
 ERROR! couldn't resolve module/action
 'arubanetworks.aos_switch.arubaoss_command'. This often indicates a
 misspelling, missing collection, or incorrect module path.
 12
 13


 On Wednesday, October 21, 2020 at 2:57:12 PM UTC-4
 phil.gr...@gmail.com wrote:

> what happens when you use the FQCN (fully qualified collection
> name) as part of the task? 
> arubanetworks.aos_switch.arubaoss_command:
>
> On Wednesday, 21 October 2020 at 15:31:07 UTC+1
> ggil...@gmail.com wrote:

Re: [ansible-project] Re: Command Not found but module is installed

2020-10-22 Thread Phil Griffiths
Check file permissions?
Also try ansible-doc -l | grep aruba to see if it can find those modules

On Thu, 22 Oct 2020 at 18:10, Fiend Busa  wrote:

> Hey,
>
> Mine are all under:  ~/.ansible/collections/ansible_collections
>
> ls -all in this directory gives me
>
> ansible
> arubanetworks
> check_point
> cisco
> community
> fortinet
>
> On Thursday, October 22, 2020 at 10:52:22 AM UTC-4 phil.gr...@gmail.com
> wrote:
>
>> what does 'ansible-galaxy collection list' output? mine are under
>> ~/.ansible/collections/ansible_collections
>> what ansible version you on?
>>
>> I'm not convinced that collection is complete as some of those modules
>> don't have docs that render for me using ansible-doc
>>
>> On Thu, 22 Oct 2020 at 15:10, Fiend Busa  wrote:
>>
>>>
>>> I can see
>>> ~./.ansible/collections/arubanetworks/aos_switch/plugins/modules/arubaoss_command.py
>>> On Thursday, October 22, 2020 at 9:48:23 AM UTC-4 Fiend Busa wrote:
>>>
 Hey,

 So all the collections are being installed in ~/.*ansible*/
 *collections*/

 ansible CFG is located in /etc/ansible.cfg

 I have other collections as well (cisco.asa) it's only the aruba one
 that is giving this error. I installed the collection directly on the
 ubuntu server and can see it under ~/.*ansible*/*collections*/
 On Wednesday, October 21, 2020 at 4:16:08 PM UTC-4 phil.gr...@gmail.com
 wrote:

> Ok, so this is suggesting that it can't find it on the default
> collections path to me. Do you have an ansible.cfg with anything in it for
> collections and where did you install the collection?
>
> On Wed, 21 Oct 2020 at 21:10, Fiend Busa  wrote:
>
>> Hey,
>>
>> I get the same error:
>> ERROR! couldn't resolve module/action
>> 'arubanetworks.aos_switch.arubaoss_command'. This often indicates a
>> misspelling, missing collection, or incorrect module path.
>> 12
>> 13
>>
>>
>> On Wednesday, October 21, 2020 at 2:57:12 PM UTC-4
>> phil.gr...@gmail.com wrote:
>>
>>> what happens when you use the FQCN (fully qualified collection name)
>>> as part of the task? arubanetworks.aos_switch.arubaoss_command:
>>>
>>> On Wednesday, 21 October 2020 at 15:31:07 UTC+1 ggil...@gmail.com
>>> wrote:
>>>
 ---
 - hosts: all
   gather_facts: false
   connection: local
   become: yes
   become_method: enable

   collections:
 - arubanetworks.aos_switch

   tasks:
 - name: Show running configuration
   arubaoss_command:
 commands: ['show run']

 ERROR! couldn't resolve module/action 'arubaoss_command'. This
 often indicates a misspelling, missing collection, or incorrect module
 path.

 Server where ansible is installed tells me its already installed
 https://galaxy.ansible.com/arubanetworks/aos_switch

>>> --
>> 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/3vYUd0vit2Q/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> ansible-proje...@googlegroups.com.
>
>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/d6965e56-6a75-41d3-838b-88f8418f4d7dn%40googlegroups.com
>> 
>> .
>>
> --
>>> 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/3vYUd0vit2Q/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> ansible-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/198d5361-29cb-435b-949a-62e3f07c4e58n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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/3vYUd0vit2Q/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/a8fdaaa3-9c70-4f98-bf2a-f397d88ac4ffn%40googlegroups.com
> 

Re: [ansible-project] Re: Command Not found but module is installed

2020-10-22 Thread Phil Griffiths
I suggest you update ansible so you get support for list. It also has a
verify option now as well so you’ll find it useful in these situations.

On Thu, 22 Oct 2020 at 18:09, Fiend Busa  wrote:

> ansible-galaxy collection list doesn't work. No such argument list
> On Thursday, October 22, 2020 at 10:52:22 AM UTC-4 phil.gr...@gmail.com
> wrote:
>
>> what does 'ansible-galaxy collection list' output? mine are under
>> ~/.ansible/collections/ansible_collections
>> what ansible version you on?
>>
>> I'm not convinced that collection is complete as some of those modules
>> don't have docs that render for me using ansible-doc
>>
>> On Thu, 22 Oct 2020 at 15:10, Fiend Busa  wrote:
>>
>>>
>>> I can see
>>> ~./.ansible/collections/arubanetworks/aos_switch/plugins/modules/arubaoss_command.py
>>> On Thursday, October 22, 2020 at 9:48:23 AM UTC-4 Fiend Busa wrote:
>>>
 Hey,

 So all the collections are being installed in ~/.*ansible*/
 *collections*/

 ansible CFG is located in /etc/ansible.cfg

 I have other collections as well (cisco.asa) it's only the aruba one
 that is giving this error. I installed the collection directly on the
 ubuntu server and can see it under ~/.*ansible*/*collections*/
 On Wednesday, October 21, 2020 at 4:16:08 PM UTC-4 phil.gr...@gmail.com
 wrote:

> Ok, so this is suggesting that it can't find it on the default
> collections path to me. Do you have an ansible.cfg with anything in it for
> collections and where did you install the collection?
>
> On Wed, 21 Oct 2020 at 21:10, Fiend Busa  wrote:
>
>> Hey,
>>
>> I get the same error:
>> ERROR! couldn't resolve module/action
>> 'arubanetworks.aos_switch.arubaoss_command'. This often indicates a
>> misspelling, missing collection, or incorrect module path.
>> 12
>> 13
>>
>>
>> On Wednesday, October 21, 2020 at 2:57:12 PM UTC-4
>> phil.gr...@gmail.com wrote:
>>
>>> what happens when you use the FQCN (fully qualified collection name)
>>> as part of the task? arubanetworks.aos_switch.arubaoss_command:
>>>
>>> On Wednesday, 21 October 2020 at 15:31:07 UTC+1 ggil...@gmail.com
>>> wrote:
>>>
 ---
 - hosts: all
   gather_facts: false
   connection: local
   become: yes
   become_method: enable

   collections:
 - arubanetworks.aos_switch

   tasks:
 - name: Show running configuration
   arubaoss_command:
 commands: ['show run']

 ERROR! couldn't resolve module/action 'arubaoss_command'. This
 often indicates a misspelling, missing collection, or incorrect module
 path.

 Server where ansible is installed tells me its already installed
 https://galaxy.ansible.com/arubanetworks/aos_switch

>>> --
>> 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/3vYUd0vit2Q/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> ansible-proje...@googlegroups.com.
>
>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/d6965e56-6a75-41d3-838b-88f8418f4d7dn%40googlegroups.com
>> 
>> .
>>
> --
>>> 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/3vYUd0vit2Q/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> ansible-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/198d5361-29cb-435b-949a-62e3f07c4e58n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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/3vYUd0vit2Q/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/bc501294-8b3c-4c22-be62-7fd0e0deae20n%40googlegroups.com
> 
> .
>

-- 

Re: [ansible-project] Re: Command Not found but module is installed

2020-10-22 Thread Phil Griffiths
what does 'ansible-galaxy collection list' output? mine are under
~/.ansible/collections/ansible_collections
what ansible version you on?

I'm not convinced that collection is complete as some of those modules
don't have docs that render for me using ansible-doc

On Thu, 22 Oct 2020 at 15:10, Fiend Busa  wrote:

>
> I can see
> ~./.ansible/collections/arubanetworks/aos_switch/plugins/modules/arubaoss_command.py
> On Thursday, October 22, 2020 at 9:48:23 AM UTC-4 Fiend Busa wrote:
>
>> Hey,
>>
>> So all the collections are being installed in ~/.*ansible*/*collections*/
>>
>> ansible CFG is located in /etc/ansible.cfg
>>
>> I have other collections as well (cisco.asa) it's only the aruba one that
>> is giving this error. I installed the collection directly on the ubuntu
>> server and can see it under ~/.*ansible*/*collections*/
>> On Wednesday, October 21, 2020 at 4:16:08 PM UTC-4 phil.gr...@gmail.com
>> wrote:
>>
>>> Ok, so this is suggesting that it can't find it on the default
>>> collections path to me. Do you have an ansible.cfg with anything in it for
>>> collections and where did you install the collection?
>>>
>>> On Wed, 21 Oct 2020 at 21:10, Fiend Busa  wrote:
>>>
 Hey,

 I get the same error:
 ERROR! couldn't resolve module/action
 'arubanetworks.aos_switch.arubaoss_command'. This often indicates a
 misspelling, missing collection, or incorrect module path.
 12
 13


 On Wednesday, October 21, 2020 at 2:57:12 PM UTC-4 phil.gr...@gmail.com
 wrote:

> what happens when you use the FQCN (fully qualified collection name)
> as part of the task? arubanetworks.aos_switch.arubaoss_command:
>
> On Wednesday, 21 October 2020 at 15:31:07 UTC+1 ggil...@gmail.com
> wrote:
>
>> ---
>> - hosts: all
>>   gather_facts: false
>>   connection: local
>>   become: yes
>>   become_method: enable
>>
>>   collections:
>> - arubanetworks.aos_switch
>>
>>   tasks:
>> - name: Show running configuration
>>   arubaoss_command:
>> commands: ['show run']
>>
>> ERROR! couldn't resolve module/action 'arubaoss_command'. This often
>> indicates a misspelling, missing collection, or incorrect module path.
>>
>> Server where ansible is installed tells me its already installed
>> https://galaxy.ansible.com/arubanetworks/aos_switch
>>
> --
 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/3vYUd0vit2Q/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
>>>
>>>
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/d6965e56-6a75-41d3-838b-88f8418f4d7dn%40googlegroups.com
 
 .

>>> --
> 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/3vYUd0vit2Q/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/198d5361-29cb-435b-949a-62e3f07c4e58n%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/CAJ3TUwj4Nway6zjc5GCssRPivmoj4LjUySZQm9G%2BheFqzXaCDA%40mail.gmail.com.


Re: [ansible-project] Re: Command Not found but module is installed

2020-10-21 Thread Phil Griffiths
Ok, so this is suggesting that it can't find it on the default collections
path to me. Do you have an ansible.cfg with anything in it for collections
and where did you install the collection?

On Wed, 21 Oct 2020 at 21:10, Fiend Busa  wrote:

> Hey,
>
> I get the same error:
> ERROR! couldn't resolve module/action
> 'arubanetworks.aos_switch.arubaoss_command'. This often indicates a
> misspelling, missing collection, or incorrect module path.
> 12
> 13
>
>
> On Wednesday, October 21, 2020 at 2:57:12 PM UTC-4 phil.gr...@gmail.com
> wrote:
>
>> what happens when you use the FQCN (fully qualified collection name) as
>> part of the task? arubanetworks.aos_switch.arubaoss_command:
>>
>> On Wednesday, 21 October 2020 at 15:31:07 UTC+1 ggil...@gmail.com wrote:
>>
>>> ---
>>> - hosts: all
>>>   gather_facts: false
>>>   connection: local
>>>   become: yes
>>>   become_method: enable
>>>
>>>   collections:
>>> - arubanetworks.aos_switch
>>>
>>>   tasks:
>>> - name: Show running configuration
>>>   arubaoss_command:
>>> commands: ['show run']
>>>
>>> ERROR! couldn't resolve module/action 'arubaoss_command'. This often
>>> indicates a misspelling, missing collection, or incorrect module path.
>>>
>>> Server where ansible is installed tells me its already installed
>>> https://galaxy.ansible.com/arubanetworks/aos_switch
>>>
>> --
> 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/3vYUd0vit2Q/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/d6965e56-6a75-41d3-838b-88f8418f4d7dn%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/CAJ3TUwidFOBsWNxZfdNKONMjMZxLtyKnzNFecE1FM1hZeCXO0w%40mail.gmail.com.


[ansible-project] Re: Playboox only runs the second time

2020-07-23 Thread Phil Griffiths
Hi Robert

This doesn't make a whole lot of sense why this would fail and then work. 
Definitely being applied to the SAME host on each run?
I suggest you post your whole playbook(s) here as there's something else 
going on outside the mentioned failing task I suspect.

As a good measure I would also include something like:

- name: Make sure psycopg2 is installed
  pip:
name: psycopg2
state: present

before you need it to ensure that base is covered as well.

Phil.


On Tuesday, 21 July 2020 19:51:10 UTC+1, robert rottermann wrote:
>
> Hi friends in Ansible
> I have a playbook that sets up a PostgreSQL environment.
> One of the tasks sets up a db user.
> This task always fails the first time. The error is, that psycopg2 could 
> not be loaded.
> If I run the playbook a second time, it works without a glitch.
>
> A clumsy solution I found is to split the playbook into two parts. Running 
> them in sequence work without a problem.
>
> Could anybody of you give me a hint on how to find a solution for this?
>
> thanks
> Robert
>
> here is the failing task:
> - name: PostgreSQL - Add the config db Odoo user
>become: true
>become_user: postgres
>postgresql_user:
>name: '{{ odoo_config_db_user }}'
>password: '{{ odoo_config_db_passwd_crypt }}'
>encrypted: yes
>role_attr_flags: '{{ odoo_postgresql_user_role_attr }}'
>ignore_errors: yes
>
>
>
>

-- 
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/d35e3cf9-af06-4135-b250-5053a8228abfo%40googlegroups.com.


[ansible-project] Re: Ansible Remote Versioning

2020-07-23 Thread Phil Griffiths
Hi Firesh

You are in danger of re-inventing the wheel here.

As Jean-Yves points out, you are starting to negate the whole point of 
Ansibles idempotency. You write something once and no matter how many times 
you run it, it checks and only makes changes as necessary. Writing a 
timestamp to every file on every remote host is not a good practice.

So you want to log what's going on? As Stefan points out look at something 
like ARA or better still look at AWX was you'll probably quickly get to the 
point of needing other features which AWX has taken care of.

Regards
Phil.

On Tuesday, 21 July 2020 07:08:57 UTC+1, Firesh Bakhda wrote:
>
> Hi ,
>
> I would like to post to this group to find out if there is anyway for 
> ansible to actually stamp the client with 
> Ansible Deployment or Deployment Stamp on what tasks were ran and when it 
> was ran, like a VERSION or DEPLOYMENT file that we could deposit to the 
> targets. 
>
> For example, 
>
> On first deployment the ansible scripts may just have tasks like: 
>
>
>1. APT UPDATE
>   2. NTPDATE
>
> this then was deployment and stamps on the client like this: 
>
>
>1. Ansible Deployment 21/07/2020 13.35pm - v1.0
>  1. Tasks:
> 1. APT UPDATE 21/072020 13;40pm 
> 2. NTPDATE 21/072020 13.42pm
>  
>
> Then this ansible script was updated to contain 2 more tasks like the 
> below:
>
>
>1. APT UPDATE
>   2. TIMESYNC DAEMON UPDATE
>   3. NTPDATE
>   4. PROXY UPDATE
>
> And when this was ran again, the target system file gets updated once it 
> completes with:
>
>
>1. Ansible Deployment 21/07/2020 13.35pm - v1.0
>  1. Tasks:
> 1. APT UPDATE 21/072020 13;40pm 
> 2. NTPDATE 21/072020 13.42pm
>  2. Ansible Deployment 21/07/2020 14.00pm - v1.1
>  1. Tasks:
> 1. APT UPDATE 21/07/2020 14.01pm
> 2. TIMESYNC DAEMON UPDATE 21/07/2020 14.03pm
> 3. NTPDATE 21/07/2020 14.04pm
> 4. PROXY UPDATE 21/07/2020 14.07pm
>  
>
>
> Something like this, this allows those who are maintaining individual 
> platforms gets to know if the deployed platform is upto date or not. 
> This would also help to know if the target system is to the latest 
> deployment or not. 
> Or is there any mechanism for this  ?
>
>
>
>

-- 
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/f9d48506-f3a9-4701-87aa-5b3dad92f49bo%40googlegroups.com.


[ansible-project] Re: REST API to add host to inventory for Ansible Tower is Not working!

2020-04-20 Thread Phil Griffiths
Hi Vivek

As Stefan mentioned this list is not for AWX/Tower queries, BUT please take 
a look at either the tower-cli or awx-cli depending on your version and 
also the tower specific modules for doing such tasks. For instance, 
https://docs.ansible.com/ansible/latest/modules/tower_host_module.html#tower-host-module

Regards
Phil.

On Friday, 17 April 2020 14:40:27 UTC+1, Vivek Mandal wrote:
>
> Hi,
>I have been trying to execute a REST API to
> Add a host to an inventory.Below is the API.
>
> /api/v2/inventories/{id}/hosts/
>
> Unfortunately, This API doesn't work. It gives the response as 200(Ok). 
> But only displays the existing host. Its the same response when you run GET 
> method for the same API call. Can someone please help me rectifying the 
> error.
>
> Thanks,
> Vivek
>
>

-- 
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/d2d6791b-4585-4b2e-b7f6-b9f3de965012%40googlegroups.com.


Re: [ansible-project] Re: Relation between Ansible and SDN

2020-04-20 Thread Phil Griffiths
Nabil

As with everything Ansible it comes down to the modules- this is a link to 
the complete list: 
https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html
Have a look through there for anything SDN related for the solution you're 
looking for. There is no such generic 'sdn' module(s) so you need to look 
at vendor specific ones (if they exist)

Regards
Phil.

On Monday, 20 April 2020 15:44:08 UTC+1, nabil hama wrote:
>
>
> Hello Albert,
>
> Thanks a lot for your feedback.
>
> Please do know how it works (using Ansible for SDN automation)? if not, do 
> you know where can I find this details?
>
> Thanks in advance
>
> BR
> Le lundi 20 avril 2020 15:36:20 UTC+1, Albert Short a écrit :
>>
>> There are a number of vendors that use Ansible for SDN automation.
>>
>> Cisco as you mentioned for ACI & or traditional networking
>> Cumulus Networks also uses Ansible
>> If you wanted you could use it for NSX but vRa may help you there.
>>
>> There are git repositories, just need to know where to look :)
>>
>>
>> On Monday, 20 April 2020 15:59:52 UTC+2, nabil hama wrote:
>>>
>>> Hello Karl,
>>>
>>> Effectively, I google it, I understood for Ansible but not the relation 
>>> between it and SDN.  Apart Cisco who talked about this topic, no other 
>>> person talking about this subject.
>>>
>>> Many thanks for feedback, which very helpful for me.
>>>
>>> best regards   
>>>
>>> Le lundi 20 avril 2020 14:09:04 UTC+1, Karl Auer a écrit :

 Hullo Nabil.

 On Mon, 20 Apr 2020 at 13:44, nabil hama  wrote:>
> I have confusion between the utilization of Ansible and  SDN,   As 
> long as the 

 SDN offers network automation, optimization and high flexibility, what 
> is the 

 role of Ansible in that network?  are two different subjects and work 
> totally 

 separately?
>

 They are two different subjects and work totally separately. However, 
 if you can find (or write!) Ansible modules that manipulate SDNs, you 
 could 
 then use Ansible to do that.

 Regards, K.



 -- 

 *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/a63afb1f-c4e1-4920-927b-0213d469aade%40googlegroups.com.


[ansible-project] Re: Is there a way we can delay the connection instead of unreachable

2020-04-07 Thread Phil Griffiths
This just sounds like a really bad idea! Having plays hanging around 
waiting for 20 days doesn't sound sensible.
Why not just fail controllably after a number of retries perhaps?

I use something like this to do this:
...tasks...
register: output
until: output is not failed
retries: 3

On Monday, 6 April 2020 06:09:22 UTC+1, Work-Hard wrote:
>
> Hello,
>
> ISSUE -  Whenever a user in a company is not connected to the vpn; ansible 
> fails the connection (as unreachable). Is there a way we can delay the 
> connection for 20 days and have it keep trying every hour, instead of 
> showing "unreachable"?
>
> REASON-  I need the output to look clean when I save the file in order to 
> validate within the company.
>
> I appreciate your help!
>
> Thanks
>

-- 
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/b4d89d60-3ce0-4477-90b8-912fdee0d1ad%40googlegroups.com.


[ansible-project] Re: Usage of ansible collection with ansible roles

2020-04-07 Thread Phil Griffiths
Hi Luca

It's still early days for collections, so some things need ironing out, 
like https://github.com/ansible/ansible/issues/68198 [we'll have to see 
what happens here]

You either need to use FQCNs (Fully Qualified Collection Names) or better 
still metadata - see 
https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#using-collections-in-roles
(this appears to be only in the devel docs branch for now)

Regards
Phil.

On Tuesday, 7 April 2020 07:52:10 UTC+1, Luca wrote:
>
> Hello everybody,
>
> How I can use an ansible collection inside an ansible role (that I cannot 
> modify)?
>
> I need to use the ansible collection ovirt.ovirt_collection (new features 
> in the modules that are not in ansible 2.9.6) with ansible roles to manage 
> an oVirt cluster but the roles use the default modules. 
> Do you know how to force the use of the modules inside the collection?
>
>
> Regards,
> Luca
>

-- 
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/6f1c4d3e-68ee-459b-8726-c9e5befe2785%40googlegroups.com.


[ansible-project] Re: ansible cmdb? Whats the recommended way to store facts for later retrieval?

2020-04-01 Thread Phil Griffiths
Hi Dennis

Does it have to be MySQL? The reason I ask, is that there are various cache 
plugins available: 
https://docs.ansible.com/ansible/latest/plugins/cache.html#plugin-list
One such plugin is, for example, redis. You could use that and then the 
redis module: https://docs.ansible.com/ansible/2.5/plugins/lookup/redis.html in 
playbooks to retrieve facts.

BUT, if you are going to all this trouble, then I would start looking at 
AWX/Tower as that has inbuilt fact caching. Why reinvent the wheel.

Regards
Phil.

On Wednesday, 1 April 2020 16:46:42 UTC+1, Dennis McCarthy wrote:
>
> Hi,
>
> I'm trying to set up a MySQL DB to hold all the ansible facts I produce 
> from "ansible -m setup" (on lots of remote hosts), Store each .json file of 
> each server in a directory but I'm having trouble finding a place to store 
> them.
>
> *What do I want to do:*
> Well I've come from a puppet background, and one of the great things about 
> puppet was puppetDB. I could query the DB for all sorts of facts (from 
> facter including custom facts) and join them together. It was very powerful 
> and I could get answers about my server estate quickly. So what I want is a 
> way to setup the same thing in Ansible. Basically, to know how many of 
> "something" I have in my estate (of 1000+ nodes) without having to use 
> ansible to visit each one to find the answer.
>
> *What have I done so far:*
> I've played with https://github.com/fboender/ansible-cmdb
> It's a great tool and sort of does what I want but it doesn't list out all 
> the fields in the DB that are in the .json file.
>
> I get these:
>
> mysql> DESCRIBE hosts;
> ++--+--+-+-+---+
> | Field  | Type | Null | Key | Default | Extra |
> ++--+--+-+-+---+
> | name   | varchar(255) | YES  | | NULL|   |
> | fqdn   | varchar(255) | YES  | | NULL|   |
> | main_ip| varchar(15)  | YES  | | NULL|   |
> | os_name| varchar(80)  | YES  | | NULL|   |
> | os_version | varchar(40)  | YES  | | NULL|   |
> | system | varchar(40)  | YES  | | NULL|   |
> | kernel | varchar(40)  | YES  | | NULL|   |
> | arch_hardware  | varchar(12)  | YES  | | NULL|   |
> | arch_userspace | varchar(12)  | YES  | | NULL|   |
> | virt_type  | varchar(20)  | YES  | | NULL|   |
> | virt_role  | varchar(20)  | YES  | | NULL|   |
> | cpu_type   | varchar(60)  | YES  | | NULL|   |
> | vcpus  | int(11)  | YES  | | NULL|   |
> | ram| float| YES  | | NULL|   |
> | disk_total | float| YES  | | NULL|   |
> | disk_free  | float| YES  | | NULL|   |
> ++--+--+-+-+---+
>
> But not all of the .json fields are available and no custom facts. Maybe I 
> need to play with this a bit more.
>
> *What do I want:*
> I'd love to be able to get a .json host file and import it directly into 
> MySQL. add to the exiting table and be able to run a select statement on 
> it. I guess this is why ansible-cmdb is around because there is nothing 
> that already does this.
>
> Can anyone recommend anyway to store the data so it can be queried on mass?
>
> Any help would be appreciated.
>
> Thanks
> Dennis
>

-- 
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/86e64844-d8d3-48f1-8e40-796fdfaae9ba%40googlegroups.com.


Re: [ansible-project] Another Ansible Question

2020-03-16 Thread Phil Griffiths
Hi Michael

You might want to check out ansible-runner: 
https://ansible-runner.readthedocs.io/en/latest/container.html
There's also something like molecule which is designed for testing roles, 
and can be used with docker: 
https://molecule.readthedocs.io/en/latest/index.html
If you want to see how the latter works, check out this exercise: 
https://github.com/pharriso/ansible_workshop/tree/master/exercises/ansible_rhel/molecule

Regards
Phil.

On Monday, 16 March 2020 12:05:09 UTC, Michael Cooper wrote:
>
> Hello Felix,
>
> I kind of figured that was going to be the story.
>
> It would be nice if there was an easy way to do this, I am tring to get 
> away from the VM route and go with containers. I will have to keep 
> researching.
>
> Thanks,
>
> On Monday, March 16, 2020 at 6:17:07 AM UTC-4, Felix Fontein wrote:
>>
>> Hi, 
>>
>> according to the description on 
>> https://hub.docker.com/r/ansible/ansible the Docker image 
>> ansible/ansible is "[...] for automated testing of Ansible. They do not 
>> include Ansible and are not for end users." 
>>
>> So please don't use that image if you want to run Ansible. 
>>
>> I'm not sure whether there are pre-built images for running Ansible, 
>> especially because the requirements depend a lot on which plugins you 
>> are using. You probably need to create your own: base it on some image 
>> which includes Python and install Ansible and all requirements via pip. 
>>
>> Cheers, 
>> Felix 
>>
>>
>>
>> PS: please note that not all participants are male on this mailing list. 
>>
>>
>>
>>
>> On Mon, 16 Mar 2020 03:02:17 -0700 (PDT) 
>> Michael Cooper  wrote: 
>>
>> > Hey Guys, 
>> > 
>> >I am trying to get ansible working on docker. The image that I 
>> > am using is ansible/ansible and there are no instructions for a run 
>> > line on it. 
>> > 
>> > So this is what I tried but it doesn't work. 
>> > 
>> > docker run -dit --name cfANS --ip xxx.xxx.x.xx --network=CFSNET -p 
>> > 22:22 -v /mnt/clusterfs/ansible:/etc/ansible ansible/ansible 
>> > 
>> > The following is the result of the run line: 
>> > a1cd233bf9f2ansible/ansible:ubuntu1604   "/sbin/init" 
>> > 7 seconds ago   Exite d 
>> > (1) 4 seconds ago 
>> > 
>> > Any help with this would be appreciated 
>> > Thanks everyone 
>> > 
>>
>

-- 
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/41cf42d9-9a91-4f65-ba13-d7d00ae68bee%40googlegroups.com.


Re: [ansible-project] Re: Ansible passwordless login not working

2020-01-22 Thread Phil Griffiths
I only removed the SSH key to remove pub key authentication from the router. As 
it’s the first authentication protocol used, the ansible command was ignoring 
the passed in username/password.
It was for testing only. Your router config does pub key -> kbd interactive -> 
password authentication out the box. If you’ve got a working ssh key then it 
won’t get to password auth.

I think you’re hitting the bug I mentioned. I did some testing yesterday with 
pip installs around paramiko and it broke with later versions. 

Check your version : pip list | grep paramiko
Try pinning it to 2.0.2 - pip install paramiko==2.0.2 (you might need to use 
sudo with this depending on where you’ve installed, if you’re not root)



> On 22 Jan 2020, at 08:11, Yehuda Pinhas  wrote:
> 
> [ansible@Netauto-Dev new_vlan]$ ansible -m ios_command -e commands='sh ip int 
> br' -i /etc/ansible/inventory/ R-TEST-SNIF -e 
> 'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e 
> 'remote_user=ansible' -k
> SSH password: 
> [WARNING]: Found variable using reserved name: remote_user
> 
> R-TEST-SNIF | FAILED! => {
> "changed": false, 
> "msg": "No existing session"
> 
> 
> This is my result..
> 
> I think I dont understand a couple of things:
> 1. Why do you have to remove the SSH keys from the router? should'nt it use 
> the SSH keys as primary method and then fallback to using password?
> 2. What exactly did you do on the cisco device to remove the keys? (although 
> I dont beleive it is a solution for me since I cant remove SSH keys on 
> devices in my real network)
> 3. There isn't a way to do password authentication without removing SSH keys?
> 
> -- 
> 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/VeJcHLrMyQc/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/02bb6e11-cfd3-41fe-b52e-7fc8433a1991%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/EBEC8567-0243-4BC2-94C9-A741E2B2DE13%40gmail.com.


Re: [ansible-project] Re: Ansible passwordless login not working

2020-01-21 Thread Phil Griffiths
I’ve tried a few connections:

It seems that ansible_user is not honoured with the network_cli plugin so make 
sure you’re not using that still:

$ ansible cisco -m ios_command -a "commands='sh ip int br'" -e 
'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e 
'ansible_user=ansible' -k
SSH password:
rtr1 | FAILED! => {
"changed": false,
"msg": "Failed to authenticate: Authentication failed."
}

Both remote_user and -u username work for me:

$ ansible cisco -m ios_command -a "commands='sh ip int br'" -e 
'ansible_connection=network_cli' -e 'ansible_network_os=ios' -u ansible -k
SSH password:
rtr1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Interface  IP-Address  OK? Method Status   
 Protocol\nGigabitEthernet1   172.16.253.234  YES DHCP   up 
   up  \nLoopback0  192.168.1.1 YES manual up   
 up  \nTunnel010.100.100.1YES manual up 
   up  \nTunnel110.200.200.1YES manual up   
 up  \nVirtualPortGroup0  192.168.35.101  YES TFTP   up 
   up"
],
"stdout_lines": [
[
"Interface  IP-Address  OK? Method Status   
 Protocol",
"GigabitEthernet1   172.16.253.234  YES DHCP   up   
 up  ",
"Loopback0  192.168.1.1 YES manual up   
 up  ",
"Tunnel010.100.100.1YES manual up   
 up  ",
"Tunnel110.200.200.1YES manual up   
 up  ",
"VirtualPortGroup0  192.168.35.101  YES TFTP   up   
 up"
]
]
}


$ ansible cisco -m ios_command -a "commands='sh ip int br'" -e 
'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e 
'remote_user=ansible' -k
SSH password:
[WARNING]: Found variable using reserved name: remote_user

rtr1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"stdout": [
"Interface  IP-Address  OK? Method Status   
 Protocol\nGigabitEthernet1   172.16.253.234  YES DHCP   up 
   up  \nLoopback0  192.168.1.1 YES manual up   
 up  \nTunnel010.100.100.1YES manual up 
   up  \nTunnel110.200.200.1YES manual up   
 up  \nVirtualPortGroup0  192.168.35.101  YES TFTP   up 
   up"
],
"stdout_lines": [
[
"Interface  IP-Address  OK? Method Status   
 Protocol",
"GigabitEthernet1   172.16.253.234  YES DHCP   up   
 up  ",
"Loopback0  192.168.1.1 YES manual up   
 up  ",
"Tunnel010.100.100.1YES manual up   
 up  ",
"Tunnel110.200.200.1YES manual up   
 up  ",
"VirtualPortGroup0  192.168.35.101  YES TFTP   up   
 up"
]
]
}

Note that I had to remove/disable the valid SSH keys in the router, as the 
first auth method is publckey. Until I did this I could still connect.


I think you’re hitting this bug: 
https://github.com/ansible/ansible/issues/59381 
 which refers to 
https://github.com/paramiko/paramiko/issues/1390 





> On 21 Jan 2020, at 13:53, Yehuda Pinhas  wrote:
> 
> Hi!
> 
> To simplify stuff I am troubleshooting this problem with the command below:
> ansible -m ios_command -e commands='sh ip int br' -i /etc/ansible/inventory/ 
> R-TEST-SNIF -e 'ansible_connection=network_cli' -e 'ansible_network_os=ios' 
> -u ansible -k
> It will make it easier to troubleshoot this problem without messing around 
> with multiple files and folders.
> 
>   - It runs the ios_command module on the host R-TEST-SNIF that is located on 
> the inventory folder. -e is extra_vars and those are ansible_connection & 
> ansible_network_os.
> -u for username = ansible, -k for prompting SSH Password.
> 
> Result is the same - No Existing Sessions.
> Below im attaching proof that ping works and SSH by cli is working to the 
> remote router and the ansible does not.
> 
> 
> 
> 
> 
> 
> Suggestions?
> 
> -- 
> 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/VeJcHLrMyQc/unsubscribe 
> 

[ansible-project] Re: Ansible passwordless login not working

2020-01-21 Thread Phil Griffiths
Have you tried setting remote_user? see 
https://docs.ansible.com/ansible/latest/plugins/connection/network_cli.html for 
details
Also does the Cisco IOS device actually allow password authentication with 
SSH? You can check with something like: 
enable
conf term
ip ssh server authenticate user password

and show ip ssh should show password authentication as listed

>From what I can see you didn't use a straight inventory file like I 
suggested trying but just added the vars to another file?
Checkout the hosts example file here: 
https://github.com/ansible/workshops/tree/master/exercises/ansible_network/1-explore
 and 
setup something like this

Then just try ansible R-TEST-SNIF -m ping and see if that works first


On Tuesday, 14 January 2020 14:38:34 UTC, Yehuda Pinhas wrote:
>
> *Hi!!*
> *Here is my code on my /etc/ansible/roles/new_vlan/vars/new_vlan_vars.yml 
> file:*
>   ansible_ssh_common_args: 
> -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts 
>   ansible_user: ansible
>   ansible_pass: ansible
>
> *I want to disable the SSH authenticity of host check, and I dont want to 
> use public and private keys for ssh.. I want to specify the username and 
> password as modules/variables w/e...*
>
> *Its not working I think ansible doesn't use the username and password 
> ansible for some reason.*
>
>
>
>
>
> *This is my error:*
>
> [ansible@Netauto-Dev new_vlan]$ ansible-playbook new_vlan_playbook.yml
>
> PLAY [---   1. Applying Layer 2 Configuration  
>  ---] 
> **
>
> TASK [Gathering Facts] 
> 
> ok: [R-TEST-SNIF]
>
> TASK [include_vars] 
> ***
> ok: [R-TEST-SNIF]
>
> TASK [include_role : new_vlan] 
> 
>
> TASK [new_vlan : ---   1. Show VLAN   --] 
> *
> fatal: [R-TEST-SNIF]: FAILED! => {"changed": false, "msg": "command 
> timeout triggered, timeout value is 10 secs.\nSee the timeout setting 
> options in the Network Debug and Troubleshooting Guide."}
>
> PLAY RECAP 
> 
> R-TEST-SNIF: ok=2changed=0unreachable=0
> failed=1skipped=0rescued=0ignored=0   
>
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ 
> [ansible@Netauto-Dev new_vlan]$ ansible-playbook new_vlan_playbook.yml 
> -v
> ansible-playbook 2.9.1
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> [u'/home/ansible/.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
> setting up inventory plugins
> host_list declined parsing /etc/ansible/inventory/POC_ENV.yml as it did 
> not pass its verify_file() method
> script declined parsing /etc/ansible/inventory/POC_ENV.yml as it did not 
> pass its verify_file() method
> Parsed /etc/ansible/inventory/POC_ENV.yml inventory source with yaml plugin
> setting up inventory plugins
> host_list declined parsing /etc/ansible/inventory/SNIF_AGGREGATOR.yml as 
> it did not pass its verify_file() method
> script declined parsing /etc/ansible/inventory/SNIF_AGGREGATOR.yml as it 
> did not pass its verify_file() method
> Parsed /etc/ansible/inventory/SNIF_AGGREGATOR.yml inventory source with 
> yaml plugin
> setting up inventory plugins
> host_list declined parsing /etc/ansible/inventory/avaya.yml as it did not 
> pass its verify_file() method
> script declined parsing /etc/ansible/inventory/avaya.yml as it did not 
> pass its verify_file() method
> Skipping empty key (hosts) in group (avaya)
> Parsed /etc/ansible/inventory/avaya.yml inventory source with yaml plugin
> setting up inventory plugins
> host_list declined parsing /etc/ansible/inventory/branch_switch.yml as it 
> did not pass its verify_file() method
> script declined parsing /etc/ansible/inventory/branch_switch.yml as it did 
> not pass its verify_file() method
> Parsed /etc/ansible/inventory/branch_switch.yml inventory source with yaml 
> plugin
> setting up inventory plugins
> host_list declined parsing 

Re: [ansible-project] Ansible passwordless login not working

2020-01-20 Thread Phil Griffiths
What happens when you setup your inventory to something like this:

[all:vars]# these defaults can be overridden for any group in the [group:vars] 
sectionansible_connection=network_cliansible_user=ansible
[ios]...
[ios:vars]ansible_become=yesansible_become_method=enableansible_network_os=iosansible_user=ansibleansible_password=
 ansible

Try setting those values in the inventory file and see what happens

Phil.


On Monday, 20 January 2020 06:59:35 UTC, Yehuda Pinhas wrote:
>
> Hi again.
> Anyone have any idea?
>

-- 
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/26f9e384-e29c-452d-a71d-aa0a615fd6e1%40googlegroups.com.


[ansible-project] Re: How to configure prompt with 2 inputs

2020-01-10 Thread Phil Griffiths
try this?

 name: reboot ios device
  cli_command:
command: reload
prompt:
  - Save?
  - confirm
answer:
 - y
 - y



On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote:
>
> Hello Gurus
>
> I am working on ios_command module. This modules facilitates in execute 
> commands on Cisco IOS devices.
>
> While running 'reload' command it is prompting for 2 inputs, 
>
> "System configuration has been modified. Save? [yes/no]" > yes
> "Proceed with reload? [confirm]   > return character here
>
> I tried using prompts, but looks like it does not support providing 
> answers for 2 questions in 1 command. Tried expect module (could not get 
> this working)
>
> Any suggestions?
>
> My code snippet:
>
> ios_command:
>commands:
>- command: 'reload'
>  prompt:
>  -  "System configuration has been modified. Save? [yes/no]" 
>  -  "Proceed with reload? [confirm] 
> answer:
>- "\r"
>- 'yes'
>
>
>   
>
>

-- 
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/5f7e1ebb-3cd3-4fa4-9d15-7814a9597e23%40googlegroups.com.


[ansible-project] Re: Create Multiple VMs on Azure

2019-11-21 Thread Phil Griffiths
This is for AWS but you can get the concept and apply using azure modules 
instead: 
https://github.com/ffirg/ansible/blob/master/vm_orchestration/offpremise/roles/offprem/tasks/amazon.yml
Basically capture register output and then use add_host to create an in 
memory inventory to apply the rest of the config to.

On Thursday, 21 November 2019 11:29:13 UTC, Shaik wrote:
>
> Hi Team,
>
> I am working on playbook to deploy multiple virtual machines on Azure 
> cloud, and i got succeed  in that task, and am trying to run multiple tasks 
> on newly created virtual machines using the same playbook which i used for 
> creation. can somebody help me with this task please.
>
> Thanks & Regards
> -Shaik
>

-- 
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/1090eb14-983f-4ed5-9787-c3b9863a2101%40googlegroups.com.