I'm working on automating Pritunl VPN housekeeping activities. I came across the community.general.pritunl_user_info module. I created a quick test playbook, below.
My question: I don't want to execute this playbook against a host (! think!), that's why I'm trying to use the local controller . The module is supposed to access the data via the api URL, using the token. How do I account for this in my playbook or tell the playbook not to use a "host"? I know I'm missing something here.
Thank you for any and all help, most appreciated!
- name: "pritunl test"
hosts: localhost
gather_facts: no
connection: local
become: no
tasks:
- name: "list pritunl users"
community.general.pritunl_user_info:
pritunl_url: https://xxxxx/
pritunl_api_token: yyyyyy
pritunl_api_secret: zzzzzz
organization: xxyyzz
The above playbook gets skipped/fails during execution because it cannot connect to localhost. See below.
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
redirecting (type: modules) community.general.pritunl_user_info to community.general.net_tools.pritunl.pritunl_user_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: pritunl_users.yml *****************************************************************************************************************************
1 plays in pritunl_users.yml
PLAY [pritunl test] *************************************************************************************************************************************
META: ran handlers
TASK [list pritunl users] *******************************************************************************************************************************
task path: /home/.../pritunl_users.yml:8
redirecting (type: modules) community.general.pritunl_user_info to community.general.net_tools.pritunl.pritunl_user_info
redirecting (type: modules) community.general.pritunl_user_info to community.general.net_tools.pritunl.pritunl_user_info
fatal: [localhost]: FAILED! => {"changed": false, "msg": "HTTP Error 404: Not Found"}
PLAY RECAP **********************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0