aoh

A tool for running Ansible playbooks with `curl <url> | python` commands
git clone https://git.ashermorgan.net/aoh/
Log | Files | Refs | README

test_become_windows.yml (565B)


      1 # Adapted from Ansible's test/integration/targets/connection_windows_ssh/tests.yml
      2 
      3 - hosts: aoh
      4   tasks:
      5     - name: skip runas test for Unix hosts
      6       when: ansible_facts.os_family != 'Windows'
      7       block:
      8         - debug:
      9             msg: Skipping test for Unix host.
     10         - meta: end_play
     11 
     12     - name: test become on Windows
     13       win_whoami:
     14       register: win_become
     15       become: yes
     16       become_method: runas
     17       become_user: SYSTEM
     18 
     19     - name: assert become successful on Windows
     20       assert:
     21         that: win_become.account.sid == "S-1-5-18"