[ansible-project] Re: Unable to start kibana from ansible playbook

2022-03-06 Thread Roland Müller
Some editing error in my previous message:

The following gist  that I found by googling uses PIDFile definition .

https://gist.github.com/ricsiga/15654d3706e8eea9193b4bb9bd76a249

Roland Müller schrieb am Montag, 7. März 2022 um 09:53:07 UTC+2:

> Hello,
>
>
> dmc...@gmail.com schrieb am Freitag, 4. März 2022 um 19:05:22 UTC+2:
>
>> Hi,
>>
>> For my ELK role I created a service each for elasticsearch, kibana and 
>> logstash. It just makes it easier to start and stop the ELK stack 
>> components and you can enable them at boot. You can see the role I created 
>> here with all the code:
>>
>> https://github.com/dmccuk/ansible_ELK/blob/master/roles/elk_config/tasks/kibana.yml
>>
>>
>>
>> On Thursday, 3 March 2022 at 17:50:05 UTC sanjayk...@gmail.com wrote:
>>
>>>
>>> Start command nohup ./bin/kibana > /dev/null 2>&1 &
>>>
>>> After execute this command have to check kibana running mode
>>>
>>> ps aux | grep node/bin/node
>>>
>>> If i am running manually this command it is working fine but running 
>>> from ansible playbook it is not working. Please help me.
>>>
>>> Thanks in Advance...!!!
>>>
>>>
>>>
>>>
> your role uses systemd. Therefore, may be the best solution should be to 
> have the check whether service is running in systemd service rather than in 
> Ansible. On Ansible side then one would use only the service and systemd 
> modules.
>
> The following gist  uses PIDFile definition by googling. 
>
> https://gist.github.com/ricsiga/15654d3706e8eea9193b4bb9bd76a249
> ...
> [Service]
> PIDFile=/var/run/kibana.pid
>
> BR,
> Roland
>  
>

-- 
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/1ec81001-aacb-4e5c-9d51-fa60859efdb6n%40googlegroups.com.


[ansible-project] Re: Unable to start kibana from ansible playbook

2022-03-06 Thread Roland Müller
Hello,


dmc...@gmail.com schrieb am Freitag, 4. März 2022 um 19:05:22 UTC+2:

> Hi,
>
> For my ELK role I created a service each for elasticsearch, kibana and 
> logstash. It just makes it easier to start and stop the ELK stack 
> components and you can enable them at boot. You can see the role I created 
> here with all the code:
>
> https://github.com/dmccuk/ansible_ELK/blob/master/roles/elk_config/tasks/kibana.yml
>
>
>
> On Thursday, 3 March 2022 at 17:50:05 UTC sanjayk...@gmail.com wrote:
>
>>
>> Start command nohup ./bin/kibana > /dev/null 2>&1 &
>>
>> After execute this command have to check kibana running mode
>>
>> ps aux | grep node/bin/node
>>
>> If i am running manually this command it is working fine but running from 
>> ansible playbook it is not working. Please help me.
>>
>> Thanks in Advance...!!!
>>
>>
>>
>>
your role uses systemd. Therefore, may be the best solution should be to 
have the check whether service is running in systemd service rather than in 
Ansible. On Ansible side then one would use only the service and systemd 
modules.

The following gist  uses PIDFile definition by googling. 

https://gist.github.com/ricsiga/15654d3706e8eea9193b4bb9bd76a249
...
[Service]
PIDFile=/var/run/kibana.pid

BR,
Roland
 

-- 
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/e7e7ae72-b0f7-4483-b41d-ebcfab4f5d34n%40googlegroups.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread Igor Cicimov
Of course it has everything to do with the module, what else? The 2.4.4 
does the correct thing and takes the list as it is: a list. The module 
documentation also says it needs to be a list.

However, 2.5+ takes that list as a string for some reason and wraps it in a 
list ending in that silly state of a list inside a list. That can't be 
right.



On Monday, March 7, 2022 at 5:08:08 PM UTC+11 Felix Fontein wrote:

> hi,
>
> > Hi all,
> > 
> > Anyone knows why is apt behaving differently here? I have this var
>
> I don't think this is related to the apt module, but to how the
> variable ends up being loaded. It seems to end up as a string, but not
> as a sting in JSON format (which would be converted to a list), but in
> Python format.
>
> Without knowing how exactly you end up with the variable in this format.
>
> (Also please note that both Ansible 2.4.x and 2.5.x are completely
> outdated and End of Line.)
>
> Cheers,
> Felix
>
>
>
> > 
> > fonts_packages:
> > - ttf-wqy-zenhei
> > - fonts-takao-mincho
> > - fonts-indic
> > - ttf-wqy-microhei
> > 
> > and simple task:
> > 
> > - name: install additional fonts
> > apt:
> > name: "{{ fonts_packages }}"
> > state: present
> > 
> > passing the list to apt.
>
>
-- 


* *







Know Your Customer due diligence on demand, powered by 
intelligent process automation




Blogs 
  |  LinkedIn 
  |  Twitter 


 




Encompass Corporation UK Ltd  |  
Company No. SC493055  |  Address: Level 3, 33 Bothwell Street, Glasgow, UK, 
G2 6NL

Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: 
Level 10, 117 Clarence Street, Sydney, New South Wales, 2000

This email 
and any attachments is intended only for the use of the individual or 
entity named above and may contain confidential information. 

If you are 
not the intended recipient, any dissemination, distribution or copying of 
this email is prohibited. 

If received in error, please notify us 
immediately by return email and destroy the original message.








-- 
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/7164ed8c-72f7-4ef1-9237-4e6be65e7092n%40googlegroups.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread 'Felix Fontein' via Ansible Project
hi,

> Hi all,
> 
> Anyone knows why is apt behaving differently here? I have this var

I don't think this is related to the apt module, but to how the
variable ends up being loaded. It seems to end up as a string, but not
as a sting in JSON format (which would be converted to a list), but in
Python format.

Without knowing how exactly you end up with the variable in this format.

(Also please note that both Ansible 2.4.x and 2.5.x are completely
outdated and End of Line.)

Cheers,
Felix



> 
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
> 
> and simple task:
> 
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
> 
>  passing the list to apt.

-- 
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/20220307070738.32c92b38%40rovaniemi.


Re: [ansible-project] Parsing json output issues

2022-03-06 Thread Dick Visser
On Mon, 7 Mar 2022 at 04:18, Delmiro Campelo  wrote:

> Hello Ansible friends,
>
> I'm hoping that you can provide some assistance here. I'm trying to parsed
> through json response from a web application, but I'm having some issues.
> The goal of this playbook is to display the site-id for all  routers in the
> json response. Any help is appreciated, thank you.
>
> *Here is the ansible playbook. *
> - hosts: vmanage
>   connection: local
>   gather_facts: no
>   tasks:
>- vmanage_device_facts:
>user: "{{ ansible_user }}"
>host: "{{ ansible_host }}"
>password: "{{ ansible_password }}"
>  register: output
>
>- name: Create device dictionary
>  set_fact:
>device_status: '{{ output | json_query("vedges[0].["side-id"]")}}'
>

Try quoting side-id with backticks




>
>- name: Print out site ids
>  debug:
>msg: "{{ device_status }}"
> ~
> *Error message after running the playbook is below:*
> PLAY [vmanage]
> **
>
> TASK [vmanage_device_facts]
> *
> [WARNING]: Module did not set no_log for password
> ok: [10.10.2.2]
>
> TASK [Create device dictionary]
> *
> fatal: [10.10.2.2]: FAILED! => {"msg": "template error while templating
> string: expected token ',', got 'side'. String: {{ output |
> json_query(\"vedges[0].[\"side-id\"]\")}}"}
>
> PLAY RECAP
> **
> 10.10.2.2  : ok=1changed=0unreachable=0
>  failed=1skipped=0rescued=0ignored=0
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d0e826f5-1ad5-49cf-b429-dc87079f896bn%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwN-h5Nw5q%2Bed50Lv5V2%2BvGsCfdaPHqwGfnFDv0rVHH1Gw%40mail.gmail.com.


[ansible-project] Parsing json output issues

2022-03-06 Thread Delmiro Campelo
Hello Ansible friends,

I'm hoping that you can provide some assistance here. I'm trying to parsed 
through json response from a web application, but I'm having some issues. 
The goal of this playbook is to display the site-id for all  routers in the 
json response. Any help is appreciated, thank you.

*Here is the ansible playbook. *
- hosts: vmanage
  connection: local
  gather_facts: no
  tasks:
   - vmanage_device_facts:
   user: "{{ ansible_user }}"
   host: "{{ ansible_host }}"
   password: "{{ ansible_password }}"
 register: output

   - name: Create device dictionary
 set_fact:
   device_status: '{{ output | json_query("vedges[0].["side-id"]")}}'

   - name: Print out site ids
 debug:
   msg: "{{ device_status }}"
~
*Error message after running the playbook is below:*
PLAY [vmanage] 
**

TASK [vmanage_device_facts] 
*
[WARNING]: Module did not set no_log for password
ok: [10.10.2.2]

TASK [Create device dictionary] 
*
fatal: [10.10.2.2]: FAILED! => {"msg": "template error while templating 
string: expected token ',', got 'side'. String: {{ output | 
json_query(\"vedges[0].[\"side-id\"]\")}}"}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d0e826f5-1ad5-49cf-b429-dc87079f896bn%40googlegroups.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread Rilindo Foster
Given John’s statement, add *update_cache: yes”

- name: install additional fonts
  apt:
name: "{{ fonts_packages }}"
state: present
update_cache: yes

> On Mar 6, 2022, at 8:10 PM, Igor Cicimov  
> wrote:
> 
> Hi all,
> 
> Anyone knows why is apt behaving differently here? I have this var
> 
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
> 
> and simple task:
> 
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
> 
>  passing the list to apt.
> 
> That works in Ansible 2.4.4 as expected:
> 
> "invocation": {
> "module_args": {
>  
> "name": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> "only_upgrade": false, 
> "package": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> ...
>  
> But in 2.5+ fails because:
> 
> fatal: [hostname]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
> 
> "name": "['ttf-wqy-zenhei', 'fonts-takao-mincho', 'fonts-indic', 
> 'ttf-wqy-microhei']",
> "only_upgrade": false,
> "package": [
> "['ttf-wqy-zenhei'",
> " 'fonts-takao-mincho'",
> " 'fonts-indic'",
> " 'ttf-wqy-microhei']"
> ],
> ...
> },
> "msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
> }
> 
> I'm passing a list to apt "name" parameter as per the documentation.
> 
> Thanks
> 
> 
>  
> 
> Know Your Customer due diligence on demand, powered by intelligent process 
> automation
> 
> Blogs   |  LinkedIn 
>   |  Twitter 
> 
>  
> 
> Encompass Corporation UK Ltd  |  Company No. SC493055  |  Address: Level 3, 
> 33 Bothwell Street, Glasgow, UK, G2 6NL
> Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: Level 10, 117 
> Clarence Street, Sydney, New South Wales, 2000
> This email and any attachments is intended only for the use of the individual 
> or entity named above and may contain confidential information. 
> If you are not the intended recipient, any dissemination, distribution or 
> copying of this email is prohibited. 
> If received in error, please notify us immediately by return email and 
> destroy the original message.
> 
> 
> 
> 
> -- 
> 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/13465a54-4216-450c-a9f9-a079495425f3n%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/CC3F3776-ED1C-4136-80F9-AE6B7AD77DDA%40gmail.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread John Petro
Usually I tend to see this when the apt cache isn't current.  I am sure
there are other reasons as well, but more than 80% of the time for me, that
usually fixes my issue.

--John

On Sun, Mar 6, 2022 at 9:11 PM Igor Cicimov 
wrote:

> Hi all,
>
> Anyone knows why is apt behaving differently here? I have this var
>
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
>
> and simple task:
>
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
>
>  passing the list to apt.
>
> That works in Ansible 2.4.4 as expected:
>
> "invocation": {
> "module_args": {
>
> "name": [
> "ttf-wqy-zenhei",
> "fonts-takao-mincho",
> "fonts-indic",
> "ttf-wqy-microhei"
> ],
> "only_upgrade": false,
> "package": [
> "ttf-wqy-zenhei",
> "fonts-takao-mincho",
> "fonts-indic",
> "ttf-wqy-microhei"
> ],
> ...
>
> But in 2.5+ fails because:
>
> fatal: [hostname]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
>
> "name": "['ttf-wqy-zenhei', 'fonts-takao-mincho',
> 'fonts-indic', 'ttf-wqy-microhei']",
> "only_upgrade": false,
> "package": [
> "['ttf-wqy-zenhei'",
> " 'fonts-takao-mincho'",
> " 'fonts-indic'",
> " 'ttf-wqy-microhei']"
> ],
> ...
> },
> "msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
> }
>
> I'm passing a list to apt "name" parameter as per the documentation.
>
> Thanks
>
>
>
>
> Know Your Customer due diligence on demand, powered by intelligent process
> automation
>
>
> Blogs   | LinkedIn
>   | Twitter
> 
>
>
>
>
> Encompass Corporation UK Ltd  | Company No. SC493055 | Address: Level 3,
> 33 Bothwell Street, Glasgow, UK, G2 6NL
>
> Encompass Corporation Pty Ltd  | ACN 140 556 896 | Address: Level 10, 117
> Clarence Street, Sydney, New South Wales, 2000
>
> This email and any attachments is intended only for the use of the
> individual or entity named above and may contain confidential information.
>
> If you are not the intended recipient, any dissemination, distribution or
> copying of this email is prohibited.
>
> If received in error, please notify us immediately by return email and
> destroy the original message.
>
>
>
>
> --
> 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/13465a54-4216-450c-a9f9-a079495425f3n%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/CAPAjob-psyniU9Fs3sFQNvxrVcYCQ0ks4gCaH7MZMJRErm3wZg%40mail.gmail.com.


[ansible-project] Apt behaviour

2022-03-06 Thread Igor Cicimov
Hi all,

Anyone knows why is apt behaving differently here? I have this var

fonts_packages:
  - ttf-wqy-zenhei
  - fonts-takao-mincho
  - fonts-indic
  - ttf-wqy-microhei

and simple task:

- name: install additional fonts
  apt:
name: "{{ fonts_packages }}"
state: present

 passing the list to apt.

That works in Ansible 2.4.4 as expected:

"invocation": {
"module_args": {
 
"name": [
"ttf-wqy-zenhei", 
"fonts-takao-mincho", 
"fonts-indic", 
"ttf-wqy-microhei"
], 
"only_upgrade": false, 
"package": [
"ttf-wqy-zenhei", 
"fonts-takao-mincho", 
"fonts-indic", 
"ttf-wqy-microhei"
], 
...
 
But in 2.5+ fails because:

fatal: [hostname]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {

"name": "['ttf-wqy-zenhei', 'fonts-takao-mincho', 
'fonts-indic', 'ttf-wqy-microhei']",
"only_upgrade": false,
"package": [
"['ttf-wqy-zenhei'",
" 'fonts-takao-mincho'",
" 'fonts-indic'",
" 'ttf-wqy-microhei']"
],
...
},
"msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
}

I'm passing a list to apt "name" parameter as per the documentation.

Thanks


-- 


* *







Know Your Customer due diligence on demand, powered by 
intelligent process automation




Blogs 
  |  LinkedIn 
  |  Twitter 


 




Encompass Corporation UK Ltd  |  
Company No. SC493055  |  Address: Level 3, 33 Bothwell Street, Glasgow, UK, 
G2 6NL

Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: 
Level 10, 117 Clarence Street, Sydney, New South Wales, 2000

This email 
and any attachments is intended only for the use of the individual or 
entity named above and may contain confidential information. 

If you are 
not the intended recipient, any dissemination, distribution or copying of 
this email is prohibited. 

If received in error, please notify us 
immediately by return email and destroy the original message.








-- 
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/13465a54-4216-450c-a9f9-a079495425f3n%40googlegroups.com.


Re: [ansible-project] Re: gather factCisco Catalyst 9300 regarding l2_interfaces

2022-03-06 Thread Sagar Paul
Hey Lucio,

Hope you are doing good!

Given our earlier conversation, the number of changes, in this case, would
be significant.
As the module is an older resource module that had all the resource module
states but lacks a parser file to break config data to structured data and
the flexibilities of newer resource modules using RMTemplateEngine.
The changes would go in -
*facts file* - l2_interfaces.py

[ *to handle the facts generation i.e breaking config data that is pulled
from a specific command to structured data *]
*config file* - l2_interfaces.py

[ *to use the structured data and deal with want and have on the basis of
states* ]
argspec file - l2_interfaces.py

 [* to support the attributes present or added in the module's model *]
these are the primary files that need change.

I would rather suggest it would be much easier as a re-write keeping the
present scope of the module intact and adding new ones that you suggested
and the change in command that pulls in the config data. If you are willing
to re-write the module and contribute, you can use
NetworkResourceModuleDevGuide

to get started and understand the collection better, the doc should help
you with getting started, and use cli_rm_builder
 to generate the
boilerplate code to start with the development. You may address the PR with
the issue 
tagged.

Regards,
Sagar Paul
*E - sagp...@redhat.com  GH - KB-perByte*

On Sun, Mar 6, 2022 at 4:04 PM L. Jankok  wrote:

> Hi Sagar,
>
> If I want to change to scope myself, can you tell me which file I need to
> patch?
>
> Regards,
>
> Lucio Jankok
>
> Op ma 7 feb. 2022 om 12:42 schreef Sagar Paul :
>
>> Hey Lucio,
>>
>> The scope of the l2_interfaces module depends on the command `show
>> running-config | section ^interface` the facts are generated with the
>> config op from the specific command. You may want to raise a feature
>> request here 
>> for an update on the scope of the module.
>>
>> Regards,
>> Sagar Paul
>> *E - sagp...@redhat.com  GH - KB-perByte*
>>
>>
>>
>> On Friday, February 4, 2022 at 8:14:51 PM UTC+5:30 lja...@gmail.com
>> wrote:
>>
>>> Hi Thom,
>>>
>>> Thank you for your time and your interest, truly appreciated.
>>> With interface templates you will not see the vlans or other port
>>> configurations on the interface when running show run int interface-name.
>>> To see the applied configuration on the interface the command "show
>>> derived-config" is needed.
>>>
>>> An example:
>>>
>>> *With a normal show run you will not see all the configs applied to the
>>> switchport*
>>>
>>> testswitch01#show run interface g1/0/1
>>>
>>> interface GigabitEthernet1/0/1
>>>
>>> no logging event link-status
>>>
>>> no cdp enable
>>>
>>> no snmp trap link-status
>>>
>>> source template ENDUSER
>>>
>>> service-policy input PM_IN_MARK
>>>
>>> end
>>>
>>>
>>> *To see all the configs applied to the switchport, do the following*
>>>
>>>
>>> testswitch01#*show derived-config interface g1/0/1*
>>>
>>> Building configuration...
>>>
>>>
>>>
>>> Derived configuration : 270 bytes
>>>
>>> !
>>>
>>> interface GigabitEthernet1/0/1
>>>
>>> description ENDUSER-WORKSTATION
>>>
>>> switchport access vlan 990
>>>
>>> switchport mode access
>>>
>>> no logging event link-status
>>>
>>> load-interval 30
>>>
>>> no cdp enable
>>>
>>> no snmp trap link-status
>>>
>>> spanning-tree portfast
>>>
>>> service-policy input PM_IN_MARK
>>>
>>> end
>>>
>>> Op vr 4 feb. 2022 om 13:59 schreef Sagar Paul :
>>>
 Hey Lucio,

 Can you share some details, I am not sure if I am getting it right.

 Regards,
 Sagar Paul
 *E - sag...@redhat.com  GH - KB-perByte*
 On Friday, February 4, 2022 at 5:53:53 PM UTC+5:30 lja...@gmail.com
 wrote:

> Hi Saga,
>
> Actually there is.
>
> The configuration is being applied using source templates.
>
> Regards,
>
> Lucio Jankok
>
> Op vr 4 feb. 2022 om 11:01 schreef Sagar Paul :
>
>>
>> Hey Lucio,
>> as I see in the config that you have shared, there is no switchport
>> or vlan data to parse as per the current scope of the module.
>> Note -
>> the interface data as shared in the above config is
>> ```
>> interface GigabitEthernet0/0
>> vrf forwarding Mgmt-vrf
>> n

Re: [ansible-project] Re: gather factCisco Catalyst 9300 regarding l2_interfaces

2022-03-06 Thread L. Jankok
Hi Sagar,

If I want to change to scope myself, can you tell me which file I need to
patch?

Regards,

Lucio Jankok

Op ma 7 feb. 2022 om 12:42 schreef Sagar Paul :

> Hey Lucio,
>
> The scope of the l2_interfaces module depends on the command `show
> running-config | section ^interface` the facts are generated with the
> config op from the specific command. You may want to raise a feature
> request here 
> for an update on the scope of the module.
>
> Regards,
> Sagar Paul
> *E - sagp...@redhat.com  GH - KB-perByte*
>
>
>
> On Friday, February 4, 2022 at 8:14:51 PM UTC+5:30 lja...@gmail.com wrote:
>
>> Hi Thom,
>>
>> Thank you for your time and your interest, truly appreciated.
>> With interface templates you will not see the vlans or other port
>> configurations on the interface when running show run int interface-name.
>> To see the applied configuration on the interface the command "show
>> derived-config" is needed.
>>
>> An example:
>>
>> *With a normal show run you will not see all the configs applied to the
>> switchport*
>>
>> testswitch01#show run interface g1/0/1
>>
>> interface GigabitEthernet1/0/1
>>
>> no logging event link-status
>>
>> no cdp enable
>>
>> no snmp trap link-status
>>
>> source template ENDUSER
>>
>> service-policy input PM_IN_MARK
>>
>> end
>>
>>
>> *To see all the configs applied to the switchport, do the following*
>>
>>
>> testswitch01#*show derived-config interface g1/0/1*
>>
>> Building configuration...
>>
>>
>>
>> Derived configuration : 270 bytes
>>
>> !
>>
>> interface GigabitEthernet1/0/1
>>
>> description ENDUSER-WORKSTATION
>>
>> switchport access vlan 990
>>
>> switchport mode access
>>
>> no logging event link-status
>>
>> load-interval 30
>>
>> no cdp enable
>>
>> no snmp trap link-status
>>
>> spanning-tree portfast
>>
>> service-policy input PM_IN_MARK
>>
>> end
>>
>> Op vr 4 feb. 2022 om 13:59 schreef Sagar Paul :
>>
>>> Hey Lucio,
>>>
>>> Can you share some details, I am not sure if I am getting it right.
>>>
>>> Regards,
>>> Sagar Paul
>>> *E - sag...@redhat.com  GH - KB-perByte*
>>> On Friday, February 4, 2022 at 5:53:53 PM UTC+5:30 lja...@gmail.com
>>> wrote:
>>>
 Hi Saga,

 Actually there is.

 The configuration is being applied using source templates.

 Regards,

 Lucio Jankok

 Op vr 4 feb. 2022 om 11:01 schreef Sagar Paul :

>
> Hey Lucio,
> as I see in the config that you have shared, there is no switchport or
> vlan data to parse as per the current scope of the module.
> Note -
> the interface data as shared in the above config is
> ```
> interface GigabitEthernet0/0
> vrf forwarding Mgmt-vrf
> no ip address
> shutdown
> negotiation auto
> !
> interface GigabitEthernet1/0/1
> no logging event link-status
> no cdp enable
> no snmp trap link-status
> source template redacted
> service-policy input redacted
> !
> interface GigabitEthernet1/0/2
> no logging event link-status
> shutdown
> no cdp enable
> no snmp trap link-status
> source template redacted
> service-policy input redacted
> !
> !
> interface GigabitEthernet1/0/24
> shutdown
> !
> interface GigabitEthernet1/1/1
> !
> interface GigabitEthernet1/1/2
> !
> interface GigabitEthernet1/1/3
> !
> interface GigabitEthernet1/1/4 ``` the module is supposed to generate
> blank facts for the device. Regards, Sagar Paul
> *E - sag...@redhat.com GH - KB-perByte*
>
> On Tuesday, February 1, 2022 at 9:14:29 PM UTC+5:30 lja...@gmail.com
> wrote:
>
>> Hi Sagar,
>>
>> The following is the case:
>>
>> *With the following platform I have no issues*
>>
>> platform: cisco WS-3850-24S
>> net_iostype: IOS-XE
>> net_version: 16.06.05
>>
>> output:
>> net_interfaces - show me interface configuration per interface
>> net_neighbors - shows me Mac address etc for all connected devices
>> l2_interfaces - shows me interface name, switchport mode and access
>> vlan
>>
>> ---
>>
>> *With the 9300 I don't get the complete l2_interfaces output*
>>
>> *platform: 9300-24p*
>> *net_iostype: IOS-XE*
>> *net_version: 17.03.03*
>>
>> net_interfaces - show me interface configuration per interface
>> net_neighbors - shows me Mac address etc for all connected devices
>> l2_interfaces - shows me only interface name. *missing switch port
>> mode and access vlan*
>>
>> 
>>
>> *Here is the redacted config for the 9300*
>>
>> Building configuration...
>>
>>
>>
>> Current configuration : 30751 bytes
>>
>> !
>>
>> !
>>
>> version 17.3
>>
>> service tcp-keepalives-in
>>
>> service timestamps debug datetime msec loca