Skip to content

Instantly share code, notes, and snippets.

@glennswest
Created June 21, 2018 14:26
Show Gist options
  • Save glennswest/cefad656b945c591b4179051f95c5fc3 to your computer and use it in GitHub Desktop.
Save glennswest/cefad656b945c591b4179051f95c5fc3 to your computer and use it in GitHub Desktop.
Ansible Windows Pipe Issue
The Ansible Script
- hosts: winnode01
gather_facts: no
tasks:
- name: grant the ansible user the SeTcbPrivilege right
win_user_right:
name: SeTcbPrivilege
users: '{{ansible_user}}'
action: add
- name: Set up the GUID for openvswitch
win_shell: "$GUID = (New-Guid).Guid; Write-Output $GUID"
register: guid
- debug: msg="Guid is {{guid.stdout | trim}}"
- name: Set the systemid
win_shell: ovs-vsctl set Open_vSwitch . external_ids:system-id="{{guid.stdout | trim}}"
[root@bastion hybrid]# ansible-playbook x.yml
PLAY [winnode01] ************************************************************************************************************************************************************************************************************************
TASK [grant the ansible user the SeTcbPrivilege right] **********************************************************************************************************************************************************************************
ok: [winnode01]
TASK [Set up the GUID for openvswitch] **************************************************************************************************************************************************************************************************
changed: [winnode01]
TASK [debug] ****************************************************************************************************************************************************************************************************************************
ok: [winnode01] => {
"msg": "Guid is e3999c75-ce7b-4a5c-9ae9-54ac359d1871"
}
TASK [Set the systemid] *****************************************************************************************************************************************************************************************************************
fatal: [winnode01]: FAILED! => {"changed": true, "cmd": "ovs-vsctl set Open_vSwitch . external_ids:system-id=\"e3999c75-ce7b-4a5c-9ae9-54ac359d1871\"", "delta": "0:00:00.478003", "end": "2018-06-21 02:24:00.839328", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-06-21 02:24:00.361325", "stderr": "2018-06-21T14:24:00Z|00002|stream_windows|ERR|Could not connect to named pipe: Access is denied.\r\r\novs-vsctl: unix:C:\\ProgramData\\openvswitch\\/db.sock: database connection failed (No such file or directory)", "stderr_lines": ["2018-06-21T14:24:00Z|00002|stream_windows|ERR|Could not connect to named pipe: Access is denied.", "", "ovs-vsctl: unix:C:\\ProgramData\\openvswitch\\/db.sock: database connection failed (No such file or directory)"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/home/glennswest/hybrid/x.retry
PLAY RECAP ******************************************************************************************************************************************************************************************************************************
winnode01 : ok=3 changed=1 unreachable=0 failed=1
@glennswest
Copy link
Author

TASK [Set the systemid] *****************************************************************************************************************************************************************************************************************
fatal: [winnode01]: FAILED! => {"changed": true, "cmd": "ovs-vsctl set Open_vSwitch . external_ids:system-id="e3999c75-ce7b-4a5c-9ae9-54ac359d1871"", "delta": "0:00:00.478003", "end": "2018-06-21 02:24:00.839328", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-06-21 02:24:00.361325", "stderr": "2018-06-21T14:24:00Z|00002|stream_windows|ERR|Could not connect to named pipe: Access is denied.\r\r\novs-vsctl: unix:C:\ProgramData\openvswitch\/db.sock: database connection failed (No such file or directory)", "stderr_lines": ["2018-06-21T14:24:00Z|00002|stream_windows|ERR|Could not connect to named pipe: Access is denied.", "", "ovs-vsctl: unix:C:\ProgramData\openvswitch\/db.sock: database connection failed (No such file or directory)"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/home/glennswest/hybrid/x.retry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment