Multicloud :: AWS OnPrem :: ssh key fails to copy on OnPrem because run_once is set to true.

Bug #1797024 reported by Ritam Gangopadhyay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Fix Released
High
Sanju Abraham

Bug Description

multicloud/ansible/gateway/playbooks/ssh_copy_id.yml

 - name: SSH copy id
   hosts: gateways
   gather_facts: no
   become: yes
   tasks:
    - name: Find key file
      shell: "find / -name {{ public_key_name }}"
      register: key_file
      run_once: true
      delegate_to: localhost
      when: provider == "onprem"

The task runs only once and fails to find the key file if its a OnPrem AWS setup and the first instance it gets has provider set to "aws"

Removing run_once helps to move forward with provisioning.

Ansible Error:-

TASK [Set authorized key] **************************************************************************************************************************************************************************
skipping: [172.10.0.19]
fatal: [192.168.100.11]: FAILED! => {"failed": true, "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/root/multicloud/ansible/gateway/playbooks/ssh_copy_id.yml': line 14, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Set authorized key\n ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no attribute 'stdout'"}

no longer affects: juniperopenstack/trunk
Changed in juniperopenstack:
milestone: r5.1.0 → r5.0.2
information type: Proprietary → Public
Revision history for this message
Ritam Gangopadhyay (ritam) wrote :
Changed in juniperopenstack:
status: New → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.