Start a Conversation

Unsolved

B

2 Posts

909

May 5th, 2022 11:00

Connect Unity from Ansible hosts

Hello 

 

I've followed instructions from below thread to set-up ansible VM. 

https://github.com/dell/ansible-unity/blob/1.3.0/README.md

Apart from last step of SSL certificate copy to /etc/pki/trust/anchors - I am able to do rest of the steps. CA signed certs are installed using method and was completed succesfully.

https://www.dell.com/support/kbdoc/en-us/000019728/dell-emc-unity-how-to-import-an-ssl-certificate-which-has-been-signed-by-a-local-certificate-authority-user-correctable

My playbook looks like below.

 

---
- hosts: inventory
collections:
- dellemc.unity
tasks:

- name: Create FileSystem
dellemc.unity.filesystem:
unispherehost: "{ {MYIP}}"
username: "{ {service}}"
password: "{ {}}"
verifycert: true
filesystem_name: "ansible_test_fs"
nas_server_name: "sfr02unioracle"
pool_name: "SFR02_Pool"
size: 5
state: "present"

 

When I run this , I am getting SSH related errors.Is it supposed to work over SSL or SSH ? Any idea on how to resolve this ?

 

TASK [Gathering Facts] **********************************************************************************************************************************************************************
fatal: [MY UNITY]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: \nWelcome to EMC Unity 480 96GB

GNOSIS_RETAIL\n\nroot@MY UNity: Permission denied (publickey,keyboard-interactive).", "unreachable": true}

May 24th, 2022 23:00

@bapatvin As per our discussion webex last week regading the issue can this issue be closed. 

1 Rookie

 • 

44 Posts

May 24th, 2022 23:00

@bapatvin, Ansible Unity modules uses REST APIs to communicate with the Unity storage array. So, these tasks need to be run locally on the ansible control node (when using Ansible CLI) or execution environments (when using AWX or Ansible Automation Platform 2.x).

There are multiple ways you can achieve this in your playbook:

  • Use local connection - you can set the connection: local in your playbook. This will direct ansible to run all the tasks in a playbook locally.
---
- hosts: inventory
  connection: local
  gather_facts: no

  collection:
    - dellemc.unity
  • Deletgate to localhost: See here for multiple ways on how you can do it. One example would be to set the 'delegate_to' keyword on a task to 'localhost'. See below for e.g.:
---
- hosts: inventory
  gather_facts: no

  collections:
  - dellemc.unity

  tasks:
  - name: Create FileSystem
    filesystem:
      unispherehost: "{{MYIP}}"
      username: "{{service}}"
      password: "{{}}"
      verifycert: true
      filesystem_name: "ansible_test_fs"
      nas_server_name: "sfr02unioracle"
      pool_name: "SFR02_Pool"
      size: 5
      state: "present"
    delegate_to: localhost

 

Hope that helps.

No Events found!

Top