Playbook: Site_inventory.yml

- hosts: switches
  gather_facts: False
  vars:
    ftp_server: 2.19.16.15

  tasks:
  - name: Include the brocade upgrade role
    include_role:
      name: brocade_upgrade
    vars:
      ip_addr: "{{ inventory_hostname }}"

playbooks:  Main.yml

- name: Retrieve the current firmware
  brocade_fos_command:
    switch_login: "{{ username }}"
    switch_password: "{{ password }}"
    switch_address: "{{ ip_addr}}"
    command_set:
    - command: firmwareshow
  register: firmwareshow_output

- name: Parse the firmwareshow output
  ansible.netcommon.cli_parse:
    text: "{{ firmwareshow_output['messages']|join('\n') }}"
    parser:
      name: ansible.netcommon.native
      template_path: "{{ role_path }}/templates/brocade_firmware.yaml"
  register: parsed_firmwareshow

inventory file:

all:
  vars:
    upgrade_path:
      v7.4.2d: "v7.4.2g"
      v8.2.1d: "v8.2.2d"
  children:
    switches:
      hosts:
        #10.1.1.2:
        #10.1.1.3:

      vars:
        username: admin
        password: password


On Friday, January 29, 2021 at 12:40:59 AM UTC+5:30 [email protected] 
wrote:

> With this amount of provided information the only thing that can be said 
> is that the issue is with site_inventory.yml 
>
>
> On Thu, 28 Jan 2021 at 19:46, [email protected] <[email protected]> 
> wrote:
>
>> I have a playbook where it has an option that can be run in 2 different 
>> ways.
>>
>> 1. When having single host to execute, can run prompt.yml file to execute 
>> against single host.
>> 2. When a large number of hosts exits, that was kept in a inventory and 
>> run against them.
>>
>> Play book is working fine when executing with site_prompt.yml, but having 
>> issue when executing again site_inventory.yml 
>>
>> SK [upgrade : Retrieve the current firmware] 
>> **************************************************************************************************************************************
>> task path: 
>> /root/brocade/ansible-fos-command/devopsweb1/roles/brocade_upgrade/tasks/main.yaml:1
>> <7.5.5.154> ESTABLISH SSH CONNECTION FOR USER: None
>> <7.5.5.154> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s 
>> -o KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o ConnectTimeout=10 -o 
>> ControlPath=/root/.ansible/cp/c6fd0bb33a 7.5.5.154 '/bin/sh -c '"'"'echo ~ 
>> && sleep 0'"'"''
>> <7.5.5.155> ESTABLISH SSH CONNECTION FOR USER: None
>> <7.5.5.155> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s 
>> -o KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o ConnectTimeout=10 -o 
>> ControlPath=/root/.ansible/cp/900bdb6d71 7.5.5.155 '/bin/sh -c '"'"'echo ~ 
>> && sleep 0'"'"''
>> <7.50.52.154> (255, b'', b'Permission denied (publickey,password).\r\n')
>> fatal: [7.5.5.154]: UNREACHABLE! => {
>> "changed": false,
>> "msg": "Failed to connect to the host via ssh: Permission denied 
>> (publickey,password).",
>> "unreachable": true
>> }
>> <7.5.5.155> (255, b'', b'Permission denied (publickey,password).\r\n')
>> fatal: [7.5.5.155]: UNREACHABLE! => {
>> "changed": false,
>> "msg": "Failed to connect to the host via ssh: Permission denied 
>> (publickey,password).",
>> "unreachable": true  
>>
>>
>> -- 
>> 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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/742a717c-ac34-4efb-a7d3-9dba0740171en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/742a717c-ac34-4efb-a7d3-9dba0740171en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> -- 
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b5cc58f9-bb60-4f54-8a8d-229768d7b754n%40googlegroups.com.

Reply via email to