Re: [ansible-project] How to set or declare a volume group as fact

2021-02-02 Thread Dick Visser
I don't think you can, you'd have to add an explicit task to fetch that
information somehow.
For example by running vgdisplay and registering the results.
If your have a recent enough OS then the lvm utilities have a json output
option which will make this a lot easier.


On Wed, 3 Feb 2021 at 03:54, Aris Aguirre  wrote:

>
> I cant see my volume group vgtemp if I will run a ansible -m setup.
> How to declare or how to make it available/define if i will run ansible -m
> setup?
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1a8ea2ea-a6dc-4034-8241-d7a3ed267a25n%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPsYBKLAkkEqjXG4SLxo-S%3DvRmoTmjiNyGZVU3MiBqVOg%40mail.gmail.com.


Re: [ansible-project] Block is working as expected but

2021-02-02 Thread Dick Visser
You should rewrite your playbook to test for the existing of such a vg, and
only add an lv if the upper vg exists.

On Wed, 3 Feb 2021 at 03:44, Aris Aguirre  wrote:

> Instead of failed for the server that doesnt have VG, it will show a
> message "no vg", instead of showing fatal error. is there a way to replace
> the fatal errors with debug message?
>
> On Tuesday, February 2, 2021 at 4:50:15 PM UTC-6 dick@geant.org wrote:
>
>> Although the docs on the size parameter don't mention a default behavior,
>> they do mention accepting a percentage of VG/PVS/FREE:
>> https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size
>> .
>> There is an example about it as well with "100%FREE":
>>
>> https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#examples
>>
>> This is what you are looking for (I think) - no need for trial and error.
>>
>>
>>
>> On Tue, 2 Feb 2021 at 22:27, Aris Aguirre  wrote:
>>
>>> Instead of throwing FATAL errors out  there, can we do something like?
>>> It will say "Volume group vgaris does not exist" if the VG doesnt exist,
>>> and if it is like creating the 3g instead of 7G, it will say,
>>> "insufficient space, will create the 3G"
>>>
>>>
>>> My playbook:
>>> ###
>>> ---
>>> - hosts: all
>>>   name: Create right VG
>>>   become: yes
>>>   tasks:
>>>
>>>   - name: Create VG now
>>> block:
>>> - name: Check 7G
>>>   lvol:
>>>  vg: vgaris
>>>  lv: lvaris
>>>  size: 7000M
>>>
>>> rescue:
>>> - name: Create a 3G
>>>   lvol:
>>>  vg: vgaris
>>>  lv: lvaris
>>>  size: 3000M
>>>
>>>
>>>
>>> #
>>>
>>>
>>>
>>>
>>>
>>> Current Output:
>>> 
>>>
>>> $ ansible-playbook block.yml
>>>
>>> PLAY [Create right VG]
>>> 
>>>
>>> TASK [Gathering Facts]
>>> 
>>> ok: [soctxlab06]
>>> ok: [soctxrhprx01]
>>> ok: [soctxseglbdev01]
>>>
>>> TASK [Check 7G]
>>> ***
>>> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume
>>> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg":
>>> "Volume group vgaris does not exist.", "rc": 5}
>>> fatal: [soctxseglbdev01]: FAILED! => {"changed": false, "err": "  Volume
>>> group \"vgaris\" has insufficient free space (1279 extents): 1750
>>> required.\n", "msg": "Creating logical volume 'lvaris' failed", "rc": 5}
>>> changed: [soctxlab06]
>>>
>>> TASK [Create a 3G]
>>> 
>>> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume
>>> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg":
>>> "Volume group vgaris does not exist.", "rc": 5}
>>> changed: [soctxseglbdev01]
>>>
>>> PLAY RECAP
>>> 
>>> soctxlab06 : ok=2changed=1unreachable=0
>>> failed=0skipped=0rescued=0ignored=0
>>> soctxrhprx01   : ok=1changed=0unreachable=0
>>> failed=1skipped=0rescued=1ignored=0
>>> soctxseglbdev01: ok=2changed=1unreachable=0
>>> failed=0skipped=0rescued=1ignored=0
>>>
>>>
>>> ###
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/8139b2d0-fae8-4871-855f-0f024eafb23en%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Dick Visser
>> Trust & Identity Service Operations Manager
>> GÉANT
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 

[ansible-project] How to set or declare a volume group as fact

2021-02-02 Thread Aris Aguirre

I cant see my volume group vgtemp if I will run a ansible -m setup.
How to declare or how to make it available/define if i will run ansible -m 
setup?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1a8ea2ea-a6dc-4034-8241-d7a3ed267a25n%40googlegroups.com.


Re: [ansible-project] Block is working as expected but

2021-02-02 Thread Aris Aguirre
Instead of failed for the server that doesnt have VG, it will show a 
message "no vg", instead of showing fatal error. is there a way to replace 
the fatal errors with debug message?

On Tuesday, February 2, 2021 at 4:50:15 PM UTC-6 dick@geant.org wrote:

> Although the docs on the size parameter don't mention a default behavior, 
> they do mention accepting a percentage of VG/PVS/FREE: 
> https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size
> .
> There is an example about it as well with "100%FREE":
>
> https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#examples
>
> This is what you are looking for (I think) - no need for trial and error.
>
>
>
> On Tue, 2 Feb 2021 at 22:27, Aris Aguirre  wrote:
>
>> Instead of throwing FATAL errors out  there, can we do something like? It 
>> will say "Volume group vgaris does not exist" if the VG doesnt exist,
>> and if it is like creating the 3g instead of 7G, it will say,  
>> "insufficient space, will create the 3G"
>>
>>
>> My playbook:
>> ###
>> ---
>> - hosts: all
>>   name: Create right VG
>>   become: yes
>>   tasks:
>>
>>   - name: Create VG now
>> block:
>> - name: Check 7G
>>   lvol:
>>  vg: vgaris
>>  lv: lvaris
>>  size: 7000M
>>
>> rescue:
>> - name: Create a 3G
>>   lvol:
>>  vg: vgaris
>>  lv: lvaris
>>  size: 3000M
>>
>>
>>
>> #
>>
>>
>>
>>
>>
>> Current Output:
>> 
>>
>> $ ansible-playbook block.yml
>>
>> PLAY [Create right VG] 
>> 
>>
>> TASK [Gathering Facts] 
>> 
>> ok: [soctxlab06]
>> ok: [soctxrhprx01]
>> ok: [soctxseglbdev01]
>>
>> TASK [Check 7G] 
>> ***
>> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume 
>> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg": 
>> "Volume group vgaris does not exist.", "rc": 5}
>> fatal: [soctxseglbdev01]: FAILED! => {"changed": false, "err": "  Volume 
>> group \"vgaris\" has insufficient free space (1279 extents): 1750 
>> required.\n", "msg": "Creating logical volume 'lvaris' failed", "rc": 5}
>> changed: [soctxlab06]
>>
>> TASK [Create a 3G] 
>> 
>> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume 
>> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg": 
>> "Volume group vgaris does not exist.", "rc": 5}
>> changed: [soctxseglbdev01]
>>
>> PLAY RECAP 
>> 
>> soctxlab06 : ok=2changed=1unreachable=0
>> failed=0skipped=0rescued=0ignored=0
>> soctxrhprx01   : ok=1changed=0unreachable=0
>> failed=1skipped=0rescued=1ignored=0
>> soctxseglbdev01: ok=2changed=1unreachable=0
>> failed=0skipped=0rescued=1ignored=0
>>
>>
>> ###
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/8139b2d0-fae8-4871-855f-0f024eafb23en%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08091689-91fc-4004-be3f-eeba00f345c6n%40googlegroups.com.


[ansible-project] Ansible-3.0.0 beta1 released

2021-02-02 Thread Toshio Kuratomi
Hi all,

We're happy to announce that the ansible-3.0.0 beta1 package is now
available! This update is based on the ansible-base-2.10.x package
just like ansible-2.10 was so the changes shouldn't be too major.
However, it does contain new major versions of many collections which
means that there will be some backwards incompatible changes in the
modules and plugins.

How to get it
-

Due to a limitation in pip, if you are upgrading from Ansible 2.9 (or
earlier), you need to uninstall ansible before installing the 3.0.0b1
version:

```
$ pip uninstall ansible
$ pip install ansible==3.0.0b1 --user
```

The tar.gz of the release can be found here:

* Ansible 3.0.0b1
https://pypi.python.org/packages/source/a/ansible/ansible-3.0.0b1.tar.gz
SHA256: 1da8059604136e520cd4f6e0792309dbf6ef79b927e6c41afc194fb418b23855

What's new in Ansible 3.0.0b1
-

* The Ansible package has moved to semantic versioning
(https://semver.org/).  This standard allows you to tell if a new
version of Ansible contains incompatibilities by looking at the
version number.  Read the semver specification for more information.

* Collections which have opted into being a part of the
Ansible-3.0.0b1 unified changelog will have an entry on this page:
https://github.com/ansible-community/ansible-build-data/blob/main/3/CHANGELOG-v3.rst

* For collections which have not opted into the unified changelog,
consult the list of included collections in the link below and check
their entry on https://galaxy.ansible.com for information about their
changes.
  * 
https://github.com/ansible-community/ansible-build-data/blob/main/3/ansible-3.0.0b1.deps

* You can find more information for those on
https://galaxy.ansible.com/. For instance, the community.crypto
collection listed in the ansible-3.0.0b1.deps file has a galaxy page
at https://galaxy.ansible.com/community/crypto/

* Changelog for ansible-base-2.10.6 which this release of ansible
installs: 
https://github.com/ansible/ansible/blob/stable-2.10/changelogs/CHANGELOG-v2.10.rst

What's the schedule for new Ansible releases after 3.0.0b1?
---

* Except for ansible-2.9.x, older versions of ansible are not seeing
maintenance releases.  If there is a desire for maintenance releases
of older versions, drop by a Community Working Group Meeting to
discuss how you can help. (
https://github.com/ansible/community/tree/main/meetings#wednesdays )
* Since we have not updated the ansible-base major version in this
release, we decided that a quick release schedule was preferred. There
will be one release candidate, on February 9.  If no blockers are
discovered, Ansible-3.0.0 final will happen on February 16, 2021.
* Minor releases of ansible-3.0.0 will be released approximately every
three weeks.  Since we're now using semantic versioning, these new
releases will be 3.1.0, 3.2.0, etc.  They will contain bugfixes and
new features but no backwards incompatibilities.


Porting Help
-

There's a unified porting guide for collections which have opted-in.
You can find that at:
https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/porting_guides/porting_guide_3.rst

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPrnkaR1nPeKDxqMWhAjT4qdEkjYh48ke_EhLRnsmaRc%2BfUUHA%40mail.gmail.com.


Re: [ansible-project] Block is working as expected but

2021-02-02 Thread Dick Visser
Although the docs on the size parameter don't mention a default behavior,
they do mention accepting a percentage of VG/PVS/FREE:
https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size
.
There is an example about it as well with "100%FREE":
https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#examples

This is what you are looking for (I think) - no need for trial and error.



On Tue, 2 Feb 2021 at 22:27, Aris Aguirre  wrote:

> Instead of throwing FATAL errors out  there, can we do something like? It
> will say "Volume group vgaris does not exist" if the VG doesnt exist,
> and if it is like creating the 3g instead of 7G, it will say,
> "insufficient space, will create the 3G"
>
>
> My playbook:
> ###
> ---
> - hosts: all
>   name: Create right VG
>   become: yes
>   tasks:
>
>   - name: Create VG now
> block:
> - name: Check 7G
>   lvol:
>  vg: vgaris
>  lv: lvaris
>  size: 7000M
>
> rescue:
> - name: Create a 3G
>   lvol:
>  vg: vgaris
>  lv: lvaris
>  size: 3000M
>
>
>
> #
>
>
>
>
>
> Current Output:
> 
>
> $ ansible-playbook block.yml
>
> PLAY [Create right VG]
> 
>
> TASK [Gathering Facts]
> 
> ok: [soctxlab06]
> ok: [soctxrhprx01]
> ok: [soctxseglbdev01]
>
> TASK [Check 7G]
> ***
> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume
> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg":
> "Volume group vgaris does not exist.", "rc": 5}
> fatal: [soctxseglbdev01]: FAILED! => {"changed": false, "err": "  Volume
> group \"vgaris\" has insufficient free space (1279 extents): 1750
> required.\n", "msg": "Creating logical volume 'lvaris' failed", "rc": 5}
> changed: [soctxlab06]
>
> TASK [Create a 3G]
> 
> fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume
> group \"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg":
> "Volume group vgaris does not exist.", "rc": 5}
> changed: [soctxseglbdev01]
>
> PLAY RECAP
> 
> soctxlab06 : ok=2changed=1unreachable=0
> failed=0skipped=0rescued=0ignored=0
> soctxrhprx01   : ok=1changed=0unreachable=0
> failed=1skipped=0rescued=1ignored=0
> soctxseglbdev01: ok=2changed=1unreachable=0
> failed=0skipped=0rescued=1ignored=0
>
>
> ###
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8139b2d0-fae8-4871-855f-0f024eafb23en%40googlegroups.com
> 
> .
>


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwOP99F7dngnBQ99d9-CWzmNs4%3DWfmiJLghAvBb-UchRJA%40mail.gmail.com.


[ansible-project] Block is working as expected but

2021-02-02 Thread Aris Aguirre
Instead of throwing FATAL errors out  there, can we do something like? It 
will say "Volume group vgaris does not exist" if the VG doesnt exist,
and if it is like creating the 3g instead of 7G, it will say,  
"insufficient space, will create the 3G"


My playbook:
###
---
- hosts: all
  name: Create right VG
  become: yes
  tasks:

  - name: Create VG now
block:
- name: Check 7G
  lvol:
 vg: vgaris
 lv: lvaris
 size: 7000M

rescue:
- name: Create a 3G
  lvol:
 vg: vgaris
 lv: lvaris
 size: 3000M



#





Current Output:


$ ansible-playbook block.yml

PLAY [Create right VG] 


TASK [Gathering Facts] 

ok: [soctxlab06]
ok: [soctxrhprx01]
ok: [soctxseglbdev01]

TASK [Check 7G] 
***
fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume group 
\"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg": 
"Volume group vgaris does not exist.", "rc": 5}
fatal: [soctxseglbdev01]: FAILED! => {"changed": false, "err": "  Volume 
group \"vgaris\" has insufficient free space (1279 extents): 1750 
required.\n", "msg": "Creating logical volume 'lvaris' failed", "rc": 5}
changed: [soctxlab06]

TASK [Create a 3G] 

fatal: [soctxrhprx01]: FAILED! => {"changed": false, "err": "  Volume group 
\"vgaris\" not found\n  Cannot process volume group vgaris\n", "msg": 
"Volume group vgaris does not exist.", "rc": 5}
changed: [soctxseglbdev01]

PLAY RECAP 

soctxlab06 : ok=2changed=1unreachable=0
failed=0skipped=0rescued=0ignored=0
soctxrhprx01   : ok=1changed=0unreachable=0
failed=1skipped=0rescued=1ignored=0
soctxseglbdev01: ok=2changed=1unreachable=0
failed=0skipped=0rescued=1ignored=0


###

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8139b2d0-fae8-4871-855f-0f024eafb23en%40googlegroups.com.


[ansible-project] Re: Powershell Function via Ansible | Get-AnsibleParam: Missing required argument: _raw_params

2021-02-02 Thread jesse...@gmail.com
Got it.

I'm attempting to not have to update just yet, we're integrating Rundeck 
organization wide and I'm hoping to just need to convert into their 
environment and call it a day.

Thanks again

On Tuesday, February 2, 2021 at 3:19:55 PM UTC-5 jbor...@gmail.com wrote:

> So your particular error is because you are using an Ansible version that 
> is too old. You are trying to run the 'ansible.windows.win_shell' 
> collection module but Ansible hardcoded in a check to only allow win_shell 
> (the builtin version). This has been fixed in recent Ansible versions (I 
> cannot which but at least 2.10) and in any case the ansible.windows version 
> requires Ansible 2.10+ anyway. So you either need to update your Ansible 
> version or not use the ansible.windows collection on 2.9.
>
> On Wednesday, February 3, 2021 at 1:33:42 AM UTC+10 jesse...@gmail.com 
> wrote:
>
>> I managed to net a better result by specifying the collection at the top 
>> of the playbook with
>>   collections:
>> - ansible.windows
>>
>>
>> and making the play 
>>
>>   - name: Hi Jason
>> win_shell: echo "HI"
>>
>> ---
>>
>> continuing on and using the same collection I managed to get the rest of 
>> my PS nonsense to work
>>
>> On Tuesday, February 2, 2021 at 8:38:37 AM UTC-5 jesse...@gmail.com 
>> wrote:
>>
>>> So pulling this from docs.ansible.com 
>>> - name: Run a command under a non-Powershell interpreter (cmd in this 
>>> case) ansible.windows.
>>> win_shell: echo %HOMEDIR% 
>>> args: executable: 
>>> cmd 
>>> register: homedir_out 
>>> -
>>> That aside, following your precise example
>>>
>>>   - ansible.windows.win_shell: echo "HI"
>>> --begin error
>>> ERROR! this task 'ansible.windows.win_shell' has extra params, which is 
>>> only allowed in the following modules: script, include, meta, include_role, 
>>> raw, set_fact, win_shell, import_tasks, group_by, import_role, shell, 
>>> include_vars, win_command, add_host, command, include_tasks
>>>
>>> The error appears to be in 
>>> '/etc/ansible/playbooks/shares/greenfield/greenfield_share_create.yml': 
>>> line 294, column 5, but may
>>> be elsewhere in the file depending on the exact syntax problem.
>>>
>>> The offending line appears to be:
>>>
>>>
>>>   - ansible.windows.win_shell: echo "HI"
>>> ^ here
>>> --end error
>>>
>>> p.s, I hate google groups now.
>>>
>>> On Monday, February 1, 2021 at 5:29:27 PM UTC-5 jbor...@gmail.com wrote:
>>>
 The win_shell and win_command modules don't support cmd as an args like 
 command/shell do. It's complaining that the raw missing is missing because 
 you haven't done 'win_shell: my command'.
 On Tuesday, February 2, 2021 at 2:40:20 AM UTC+10 jesse...@gmail.com 
 wrote:

> I've got this that I'm connecting to, doing a metric ton of other 
> things as well, so I'm positive the connection is functional and working.
>
> ansible 2.9.13
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = ['/root/.ansible/plugins/modules', 
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = 
> /usr/local/lib/python3.6/site-packages/ansible
>   executable location = /usr/local/bin/ansible
>   python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 
> 20150623 (Red Hat 4.8.5-39)]
>
>  Test play 
>
>
> #
>
>   - name: test me
> ansible.windows.win_shell:
> args:
>   cmd: echo 'hi'
>
>  Results 
>
> fatal: [SERVER.DOMAIN.net]: FAILED! => {
>
> "changed": false,
> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
> }
>
>
>
> On Thursday, January 28, 2021 at 2:28:41 PM UTC-5 jbor...@gmail.com 
> wrote:
>
>>
>> What Ansible version are you running, does it also fail with the same 
>> error if you did just "- ansible.windows.win_shell: echo 'hi'". Does 
>> win_command work, what about just "win_shell" and not the FQCN.
>> On Friday, January 29, 2021 at 2:58:30 AM UTC+10 jesse...@gmail.com 
>> wrote:
>>
>>> Crickets
>>> :(
>>>
>>> On Wednesday, January 27, 2021 at 10:41:24 AM UTC-5 
>>> jesse...@gmail.com wrote:
>>>
 Executing a rather large playbook revolving around multiple plays 
 to create shares and DFS links, etc.

 I've got a play to do the following.
 - 
   - name: Create DFS links
 ansible.windows.win_shell: |
   . C:\scripts\user\dfs_abe_func.ps1

   gf-dfsadd -junction "{{ vol_junction }}" -share_name "{{ 
 share_name }}" -prd_vserver "{{ prd_vserver_fs }}.{{ fqdn }}" 
 -dr_vserver 
 "{{ dr_vserver }}.{{ fqdn }}" -prd_state "{{ prd_state }}" -dr_state 
 "{{ 
 dr_state }}" -rogroup "{{ rogroup }}" -rwgroup "{{ rwgroup }}" 
 -fcgroup "{{ 
 h_defaultfcgroup }}" 

Re: [ansible-project] Equivalent of this inventory_hostname in groups['dev'] or inventory_hostname in groups['lb']

2021-02-02 Thread Matt Martz
There are a number of alternatives

inventory_hostname in (groups.dev + groups.lb)

inventory_hostname in lookup('inventory_hostnames', 'dev:lb')

['dev', 'lb']|intersection(group_names)

On Tue, Feb 2, 2021 at 2:44 PM ursa Brown  wrote:

>
> Is there a shortcut way for this?
> inventory_hostname in groups['dev'] or inventory_hostname in groups['lb']
> I have a long playbook, im trying to cut some text.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/505a2e16-378e-42c3-94b7-34976ef94e88n%40googlegroups.com
> 
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9tSzF3fHdwSsWExQ1BMOkuom-uSVNOiJBuMDr7-3RcJQ%40mail.gmail.com.


[ansible-project] Equivalent of this inventory_hostname in groups['dev'] or inventory_hostname in groups['lb']

2021-02-02 Thread ursa Brown

Is there a shortcut way for this?
inventory_hostname in groups['dev'] or inventory_hostname in groups['lb']
I have a long playbook, im trying to cut some text.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/505a2e16-378e-42c3-94b7-34976ef94e88n%40googlegroups.com.


[ansible-project] Re: Powershell Function via Ansible | Get-AnsibleParam: Missing required argument: _raw_params

2021-02-02 Thread jbor...@gmail.com
So your particular error is because you are using an Ansible version that 
is too old. You are trying to run the 'ansible.windows.win_shell' 
collection module but Ansible hardcoded in a check to only allow win_shell 
(the builtin version). This has been fixed in recent Ansible versions (I 
cannot which but at least 2.10) and in any case the ansible.windows version 
requires Ansible 2.10+ anyway. So you either need to update your Ansible 
version or not use the ansible.windows collection on 2.9.

On Wednesday, February 3, 2021 at 1:33:42 AM UTC+10 jesse...@gmail.com 
wrote:

> I managed to net a better result by specifying the collection at the top 
> of the playbook with
>   collections:
> - ansible.windows
>
>
> and making the play 
>
>   - name: Hi Jason
> win_shell: echo "HI"
>
> ---
>
> continuing on and using the same collection I managed to get the rest of 
> my PS nonsense to work
>
> On Tuesday, February 2, 2021 at 8:38:37 AM UTC-5 jesse...@gmail.com wrote:
>
>> So pulling this from docs.ansible.com 
>> - name: Run a command under a non-Powershell interpreter (cmd in this 
>> case) ansible.windows.
>> win_shell: echo %HOMEDIR% 
>> args: executable: 
>> cmd 
>> register: homedir_out 
>> -
>> That aside, following your precise example
>>
>>   - ansible.windows.win_shell: echo "HI"
>> --begin error
>> ERROR! this task 'ansible.windows.win_shell' has extra params, which is 
>> only allowed in the following modules: script, include, meta, include_role, 
>> raw, set_fact, win_shell, import_tasks, group_by, import_role, shell, 
>> include_vars, win_command, add_host, command, include_tasks
>>
>> The error appears to be in 
>> '/etc/ansible/playbooks/shares/greenfield/greenfield_share_create.yml': 
>> line 294, column 5, but may
>> be elsewhere in the file depending on the exact syntax problem.
>>
>> The offending line appears to be:
>>
>>
>>   - ansible.windows.win_shell: echo "HI"
>> ^ here
>> --end error
>>
>> p.s, I hate google groups now.
>>
>> On Monday, February 1, 2021 at 5:29:27 PM UTC-5 jbor...@gmail.com wrote:
>>
>>> The win_shell and win_command modules don't support cmd as an args like 
>>> command/shell do. It's complaining that the raw missing is missing because 
>>> you haven't done 'win_shell: my command'.
>>> On Tuesday, February 2, 2021 at 2:40:20 AM UTC+10 jesse...@gmail.com 
>>> wrote:
>>>
 I've got this that I'm connecting to, doing a metric ton of other 
 things as well, so I'm positive the connection is functional and working.

 ansible 2.9.13
   config file = /etc/ansible/ansible.cfg
   configured module search path = ['/root/.ansible/plugins/modules', 
 '/usr/share/ansible/plugins/modules']
   ansible python module location = 
 /usr/local/lib/python3.6/site-packages/ansible
   executable location = /usr/local/bin/ansible
   python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 
 20150623 (Red Hat 4.8.5-39)]

  Test play 


 #

   - name: test me
 ansible.windows.win_shell:
 args:
   cmd: echo 'hi'

  Results 

 fatal: [SERVER.DOMAIN.net]: FAILED! => {

 "changed": false,
 "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
 }



 On Thursday, January 28, 2021 at 2:28:41 PM UTC-5 jbor...@gmail.com 
 wrote:

>
> What Ansible version are you running, does it also fail with the same 
> error if you did just "- ansible.windows.win_shell: echo 'hi'". Does 
> win_command work, what about just "win_shell" and not the FQCN.
> On Friday, January 29, 2021 at 2:58:30 AM UTC+10 jesse...@gmail.com 
> wrote:
>
>> Crickets
>> :(
>>
>> On Wednesday, January 27, 2021 at 10:41:24 AM UTC-5 
>> jesse...@gmail.com wrote:
>>
>>> Executing a rather large playbook revolving around multiple plays to 
>>> create shares and DFS links, etc.
>>>
>>> I've got a play to do the following.
>>> - 
>>>   - name: Create DFS links
>>> ansible.windows.win_shell: |
>>>   . C:\scripts\user\dfs_abe_func.ps1
>>>
>>>   gf-dfsadd -junction "{{ vol_junction }}" -share_name "{{ 
>>> share_name }}" -prd_vserver "{{ prd_vserver_fs }}.{{ fqdn }}" 
>>> -dr_vserver 
>>> "{{ dr_vserver }}.{{ fqdn }}" -prd_state "{{ prd_state }}" -dr_state 
>>> "{{ 
>>> dr_state }}" -rogroup "{{ rogroup }}" -rwgroup "{{ rwgroup }}" -fcgroup 
>>> "{{ 
>>> h_defaultfcgroup }}" -defaultrogroup "{{ h_defaultrogroup }}" 
>>> -defaultrwgroup "{{ h_defaultrwgroup }}"
>>> -
>>> Nets the below error.
>>>
>>> fatal: [Server.Domain.net]: FAILED! => {
>>> "changed": false,
>>> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
>>> }
>>>
>>> I'm passing a bunch of variables built within the play itself, 
>>> utilizing 

Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread Dick Visser
Hi

You seem to be circling around the fact that you don't have internet
connectivity in your environment.
And the recommendations that were given by the previous posters didn't get
any traction.
There are many ways to get content onto an air gapped system.
But this is entirely dependent on your environment.
If all else fails, just download the content on an internet connected host
and copy it to your ansible host. Perhaps by USB stick, whatever works for
you.
If you don't know how to do that, then ask someone who DOES know your
environment  (your sysadmin or tech support or whatever).




On Tue, 2 Feb 2021 at 18:02, ursa Brown  wrote:

> in rhel-system-roles package the geerlinguy or haproxy role is not there.
> How will I use a geerlinguy haproxy role?
> Thanks
>
> On Tuesday, February 2, 2021 at 9:59:04 AM UTC-6 Richard Megginson wrote:
>
>> On 2/2/21 8:27 AM, ursa Brown wrote:
>>
>> For start I only have a RHEL7 iso.
>>
>>
>> In RHEL the package is called `rhel-system-roles`.
>>
>>
>>
>> On Tuesday, February 2, 2021 at 9:02:12 AM UTC-6 Richard Megginson wrote:
>>
>>> On 2/1/21 7:33 PM, ursa Brown wrote:
>>>
>>>
>>> So the yum install linux-system-roles wont fix this?
>>>
>>>
>>> Yes, you can use `yum install linux-system-roles` - what platform are
>>> you using for your Ansible controller node?  Fedora 32/33?
>>>
>>>
>>>
>>> On Monday, February 1, 2021 at 4:34:17 PM UTC-6 jbor...@gmail.com wrote:
>>>
 How do you expect to download a role from the internet if you don't
 have access to the internet in the first place. An offline flag would only
 work if you've already downloaded the roles and placed it somewhere, if
 that's the case then just copy it into the roles directory like normal
 roles.

 You can also do as the previous commenter said and mirror the content
 to a local repository and target that server when installing roles.

 On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10 ursab...@gmail.com
 wrote:

> there should be a offline flag..
>
> On Monday, February 1, 2021 at 10:34:11 AM UTC-6 jruar...@gmail.com
> wrote:
>
>> If you don't have access to the internet, then you'll have to mirror
>> the required content into your network somehow.
>>
>> FYI: https://galaxy.ansible.com/docs/using/installing.html
>>
>> You can also consider running an Pulp instance to server ansible
>> content too: https://github.com/pulp/pulp_ansible
>>
>> HTH,
>>
>>
>> El lun, 1 feb 2021 a las 17:19, ursa Brown ()
>> escribió:
>>
>>> How can I make ansible-galaxy work if it is not connected to
>>> internet?
>>> Thank you
>>>
>>>  ansible-galaxy role install linux-system-roles.network
>>>
>>> [WARNING]: - linux-system-roles. network was NOT installed
>>> successfully: Unknown error when attempting to call
>>> Galaxy at 'https://galaxy.ansible.com/api/': >> 101] Network is unreachable>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com
>>> 
>>> .
>>>
>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-proje...@googlegroups.com.
>>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com
>>> 
>>> .
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-proje...@googlegroups.com.
>>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/9f3c16b7-e95a-40f1-8298-beec03dd7726n%40googlegroups.com
>> 
>> .
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread Rich Megginson

On 2/2/21 10:01 AM, ursa Brown wrote:
in rhel-system-roles package the geerlinguy or haproxy role is not 
there. How will I use a geerlinguy haproxy role?



I don't know, but I'm curious as to why you thought the "geerlinguy 
haproxy" role was provided by the linux-system-roles or 
rhel-system-roles RPM package?




Thanks

On Tuesday, February 2, 2021 at 9:59:04 AM UTC-6 Richard Megginson wrote:

On 2/2/21 8:27 AM, ursa Brown wrote:

For start I only have a RHEL7 iso.



In RHEL the package is called `rhel-system-roles`.




On Tuesday, February 2, 2021 at 9:02:12 AM UTC-6 Richard
Megginson wrote:

On 2/1/21 7:33 PM, ursa Brown wrote:


So the yum install linux-system-roles wont fix this?



Yes, you can use `yum install linux-system-roles` - what
platform are you using for your Ansible controller node? 
Fedora 32/33?




On Monday, February 1, 2021 at 4:34:17 PM UTC-6
jbor...@gmail.com wrote:

How do you expect to download a role from the internet
if you don't have access to the internet in the first
place. An offline flag would only work if you've already
downloaded the roles and placed it somewhere, if that's
the case then just copy it into the roles directory like
normal roles.

You can also do as the previous commenter said and
mirror the content to a local repository and target that
server when installing roles.

On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10
ursab...@gmail.com wrote:

there should be a offline flag..

On Monday, February 1, 2021 at 10:34:11 AM UTC-6
jruar...@gmail.com wrote:

If you don't have access to the internet, then
you'll have to mirror the required content into
your network somehow.

FYI:
https://galaxy.ansible.com/docs/using/installing.html


You can also consider running an Pulp instance
to server ansible content too:
https://github.com/pulp/pulp_ansible


HTH,


El lun, 1 feb 2021 a las 17:19, ursa Brown
() escribió:

How can I make ansible-galaxy work if it is
not connected to internet?
Thank you

 ansible-galaxy role install
linux-system-roles.network

[WARNING]: - linux-system-roles. network was
NOT installed successfully: Unknown error
when attempting to call
Galaxy at 'https://galaxy.ansible.com/api/
': 

-- 
You received this message because you are

subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop
receiving emails from it, send an email to
ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com

.

-- 
You received this message because you are subscribed to the

Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails
from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com

.


-- 
You received this message because you are subscribed to the

Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/9f3c16b7-e95a-40f1-8298-beec03dd7726n%40googlegroups.com

.


--
You received this message because you are 

Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread ursa Brown
in rhel-system-roles package the geerlinguy or haproxy role is not there. 
How will I use a geerlinguy haproxy role?
Thanks

On Tuesday, February 2, 2021 at 9:59:04 AM UTC-6 Richard Megginson wrote:

> On 2/2/21 8:27 AM, ursa Brown wrote:
>
> For start I only have a RHEL7 iso.
>
>
> In RHEL the package is called `rhel-system-roles`.
>
>
>
> On Tuesday, February 2, 2021 at 9:02:12 AM UTC-6 Richard Megginson wrote:
>
>> On 2/1/21 7:33 PM, ursa Brown wrote:
>>
>>
>> So the yum install linux-system-roles wont fix this?
>>
>>
>> Yes, you can use `yum install linux-system-roles` - what platform are you 
>> using for your Ansible controller node?  Fedora 32/33?
>>
>>
>>
>> On Monday, February 1, 2021 at 4:34:17 PM UTC-6 jbor...@gmail.com wrote:
>>
>>> How do you expect to download a role from the internet if you don't have 
>>> access to the internet in the first place. An offline flag would only work 
>>> if you've already downloaded the roles and placed it somewhere, if that's 
>>> the case then just copy it into the roles directory like normal roles.
>>>
>>> You can also do as the previous commenter said and mirror the content to 
>>> a local repository and target that server when installing roles.
>>>
>>> On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10 ursab...@gmail.com 
>>> wrote:
>>>
 there should be a offline flag.. 

 On Monday, February 1, 2021 at 10:34:11 AM UTC-6 jruar...@gmail.com 
 wrote:

> If you don't have access to the internet, then you'll have to mirror 
> the required content into your network somehow. 
>
> FYI: https://galaxy.ansible.com/docs/using/installing.html
>
> You can also consider running an Pulp instance to server ansible 
> content too: https://github.com/pulp/pulp_ansible
>
> HTH,
>
>
> El lun, 1 feb 2021 a las 17:19, ursa Brown () 
> escribió:
>
>> How can I make ansible-galaxy work if it is not connected to internet?
>> Thank you
>>
>>  ansible-galaxy role install linux-system-roles.network
>>
>> [WARNING]: - linux-system-roles. network was NOT installed 
>> successfully: Unknown error when attempting to call
>> Galaxy at 'https://galaxy.ansible.com/api/': > 101] Network is unreachable>
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to ansible-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com
>>  
>> 
>> .
>>
>> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-proje...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/9f3c16b7-e95a-40f1-8298-beec03dd7726n%40googlegroups.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/97fadea3-5077-4f19-b4de-08fb6f308a1bn%40googlegroups.com.


Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread Rich Megginson

On 2/2/21 8:27 AM, ursa Brown wrote:

For start I only have a RHEL7 iso.



In RHEL the package is called `rhel-system-roles`.




On Tuesday, February 2, 2021 at 9:02:12 AM UTC-6 Richard Megginson wrote:

On 2/1/21 7:33 PM, ursa Brown wrote:


So the yum install linux-system-roles wont fix this?



Yes, you can use `yum install linux-system-roles` - what platform
are you using for your Ansible controller node? Fedora 32/33?




On Monday, February 1, 2021 at 4:34:17 PM UTC-6 jbor...@gmail.com
wrote:

How do you expect to download a role from the internet if you
don't have access to the internet in the first place. An
offline flag would only work if you've already downloaded the
roles and placed it somewhere, if that's the case then just
copy it into the roles directory like normal roles.

You can also do as the previous commenter said and mirror the
content to a local repository and target that server when
installing roles.

On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10
ursab...@gmail.com wrote:

there should be a offline flag..

On Monday, February 1, 2021 at 10:34:11 AM UTC-6
jruar...@gmail.com wrote:

If you don't have access to the internet, then you'll
have to mirror the required content into your network
somehow.

FYI:
https://galaxy.ansible.com/docs/using/installing.html


You can also consider running an Pulp instance to
server ansible content too:
https://github.com/pulp/pulp_ansible


HTH,


El lun, 1 feb 2021 a las 17:19, ursa Brown
() escribió:

How can I make ansible-galaxy work if it is not
connected to internet?
Thank you

 ansible-galaxy role install
linux-system-roles.network

[WARNING]: - linux-system-roles. network was NOT
installed successfully: Unknown error when
attempting to call
Galaxy at 'https://galaxy.ansible.com/api/
': 

-- 
You received this message because you are

subscribed to the Google Groups "Ansible Project"
group.
To unsubscribe from this group and stop receiving
emails from it, send an email to
ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com

.

-- 
You received this message because you are subscribed to the

Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com

.


--
You received this message because you are subscribed to the Google 
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to ansible-project+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9f3c16b7-e95a-40f1-8298-beec03dd7726n%40googlegroups.com 
.


--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/22596623-0775-e8cf-3e07-2328701b1116%40redhat.com.


[ansible-project] Re: Powershell Function via Ansible | Get-AnsibleParam: Missing required argument: _raw_params

2021-02-02 Thread jesse...@gmail.com
I managed to net a better result by specifying the collection at the top of 
the playbook with
  collections:
- ansible.windows


and making the play 

  - name: Hi Jason
win_shell: echo "HI"

---

continuing on and using the same collection I managed to get the rest of my 
PS nonsense to work

On Tuesday, February 2, 2021 at 8:38:37 AM UTC-5 jesse...@gmail.com wrote:

> So pulling this from docs.ansible.com 
> - name: Run a command under a non-Powershell interpreter (cmd in this 
> case) ansible.windows.
> win_shell: echo %HOMEDIR% 
> args: executable: 
> cmd 
> register: homedir_out 
> -
> That aside, following your precise example
>
>   - ansible.windows.win_shell: echo "HI"
> --begin error
> ERROR! this task 'ansible.windows.win_shell' has extra params, which is 
> only allowed in the following modules: script, include, meta, include_role, 
> raw, set_fact, win_shell, import_tasks, group_by, import_role, shell, 
> include_vars, win_command, add_host, command, include_tasks
>
> The error appears to be in 
> '/etc/ansible/playbooks/shares/greenfield/greenfield_share_create.yml': 
> line 294, column 5, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
>
>   - ansible.windows.win_shell: echo "HI"
> ^ here
> --end error
>
> p.s, I hate google groups now.
>
> On Monday, February 1, 2021 at 5:29:27 PM UTC-5 jbor...@gmail.com wrote:
>
>> The win_shell and win_command modules don't support cmd as an args like 
>> command/shell do. It's complaining that the raw missing is missing because 
>> you haven't done 'win_shell: my command'.
>> On Tuesday, February 2, 2021 at 2:40:20 AM UTC+10 jesse...@gmail.com 
>> wrote:
>>
>>> I've got this that I'm connecting to, doing a metric ton of other things 
>>> as well, so I'm positive the connection is functional and working.
>>>
>>> ansible 2.9.13
>>>   config file = /etc/ansible/ansible.cfg
>>>   configured module search path = ['/root/.ansible/plugins/modules', 
>>> '/usr/share/ansible/plugins/modules']
>>>   ansible python module location = 
>>> /usr/local/lib/python3.6/site-packages/ansible
>>>   executable location = /usr/local/bin/ansible
>>>   python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 
>>> 20150623 (Red Hat 4.8.5-39)]
>>>
>>>  Test play 
>>>
>>>
>>> #
>>>
>>>   - name: test me
>>> ansible.windows.win_shell:
>>> args:
>>>   cmd: echo 'hi'
>>>
>>>  Results 
>>>
>>> fatal: [SERVER.DOMAIN.net]: FAILED! => {
>>>
>>> "changed": false,
>>> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
>>> }
>>>
>>>
>>>
>>> On Thursday, January 28, 2021 at 2:28:41 PM UTC-5 jbor...@gmail.com 
>>> wrote:
>>>

 What Ansible version are you running, does it also fail with the same 
 error if you did just "- ansible.windows.win_shell: echo 'hi'". Does 
 win_command work, what about just "win_shell" and not the FQCN.
 On Friday, January 29, 2021 at 2:58:30 AM UTC+10 jesse...@gmail.com 
 wrote:

> Crickets
> :(
>
> On Wednesday, January 27, 2021 at 10:41:24 AM UTC-5 jesse...@gmail.com 
> wrote:
>
>> Executing a rather large playbook revolving around multiple plays to 
>> create shares and DFS links, etc.
>>
>> I've got a play to do the following.
>> - 
>>   - name: Create DFS links
>> ansible.windows.win_shell: |
>>   . C:\scripts\user\dfs_abe_func.ps1
>>
>>   gf-dfsadd -junction "{{ vol_junction }}" -share_name "{{ 
>> share_name }}" -prd_vserver "{{ prd_vserver_fs }}.{{ fqdn }}" 
>> -dr_vserver 
>> "{{ dr_vserver }}.{{ fqdn }}" -prd_state "{{ prd_state }}" -dr_state "{{ 
>> dr_state }}" -rogroup "{{ rogroup }}" -rwgroup "{{ rwgroup }}" -fcgroup 
>> "{{ 
>> h_defaultfcgroup }}" -defaultrogroup "{{ h_defaultrogroup }}" 
>> -defaultrwgroup "{{ h_defaultrwgroup }}"
>> -
>> Nets the below error.
>>
>> fatal: [Server.Domain.net]: FAILED! => {
>> "changed": false,
>> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
>> }
>>
>> I'm passing a bunch of variables built within the play itself, 
>> utilizing variables built from other ones, but I don't presume those are 
>> related to my issues.
>>
>> I can post most of the PS function if needed, after its been 
>> sanitized a bit.
>> Looking for ideas :/
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a0ae3616-0a08-45ec-81a9-d1a236718e4bn%40googlegroups.com.


Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread ursa Brown
For start I only have a RHEL7 iso.

On Tuesday, February 2, 2021 at 9:02:12 AM UTC-6 Richard Megginson wrote:

> On 2/1/21 7:33 PM, ursa Brown wrote:
>
>
> So the yum install linux-system-roles wont fix this?
>
>
> Yes, you can use `yum install linux-system-roles` - what platform are you 
> using for your Ansible controller node?  Fedora 32/33?
>
>
>
> On Monday, February 1, 2021 at 4:34:17 PM UTC-6 jbor...@gmail.com wrote:
>
>> How do you expect to download a role from the internet if you don't have 
>> access to the internet in the first place. An offline flag would only work 
>> if you've already downloaded the roles and placed it somewhere, if that's 
>> the case then just copy it into the roles directory like normal roles.
>>
>> You can also do as the previous commenter said and mirror the content to 
>> a local repository and target that server when installing roles.
>>
>> On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10 ursab...@gmail.com 
>> wrote:
>>
>>> there should be a offline flag.. 
>>>
>>> On Monday, February 1, 2021 at 10:34:11 AM UTC-6 jruar...@gmail.com 
>>> wrote:
>>>
 If you don't have access to the internet, then you'll have to mirror 
 the required content into your network somehow. 

 FYI: https://galaxy.ansible.com/docs/using/installing.html

 You can also consider running an Pulp instance to server ansible 
 content too: https://github.com/pulp/pulp_ansible

 HTH,


 El lun, 1 feb 2021 a las 17:19, ursa Brown () 
 escribió:

> How can I make ansible-galaxy work if it is not connected to internet?
> Thank you
>
>  ansible-galaxy role install linux-system-roles.network
>
> [WARNING]: - linux-system-roles. network was NOT installed 
> successfully: Unknown error when attempting to call
> Galaxy at 'https://galaxy.ansible.com/api/':  101] Network is unreachable>
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com
>  
> 
> .
>
 -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-proje...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9f3c16b7-e95a-40f1-8298-beec03dd7726n%40googlegroups.com.


Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread Rich Megginson

On 2/1/21 7:33 PM, ursa Brown wrote:


So the yum install linux-system-roles wont fix this?



Yes, you can use `yum install linux-system-roles` - what platform are 
you using for your Ansible controller node?  Fedora 32/33?





On Monday, February 1, 2021 at 4:34:17 PM UTC-6 jbor...@gmail.com wrote:

How do you expect to download a role from the internet if you
don't have access to the internet in the first place. An offline
flag would only work if you've already downloaded the roles and
placed it somewhere, if that's the case then just copy it into the
roles directory like normal roles.

You can also do as the previous commenter said and mirror the
content to a local repository and target that server when
installing roles.

On Tuesday, February 2, 2021 at 6:14:09 AM UTC+10
ursab...@gmail.com wrote:

there should be a offline flag..

On Monday, February 1, 2021 at 10:34:11 AM UTC-6
jruar...@gmail.com wrote:

If you don't have access to the internet, then you'll have
to mirror the required content into your network somehow.

FYI: https://galaxy.ansible.com/docs/using/installing.html


You can also consider running an Pulp instance to server
ansible content too: https://github.com/pulp/pulp_ansible


HTH,


El lun, 1 feb 2021 a las 17:19, ursa Brown
() escribió:

How can I make ansible-galaxy work if it is not
connected to internet?
Thank you

 ansible-galaxy role install linux-system-roles.network

[WARNING]: - linux-system-roles. network was NOT
installed successfully: Unknown error when attempting
to call
Galaxy at 'https://galaxy.ansible.com/api/
': 

-- 
You received this message because you are subscribed

to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving
emails from it, send an email to
ansible-proje...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com

.

--
You received this message because you are subscribed to the Google 
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to ansible-project+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f918d446-6719-4c4f-b0d3-db9bffefcebfn%40googlegroups.com 
.


--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/92bbafa5-6508-ed0d-6e3e-0e8cfe4eb16a%40redhat.com.


Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread Jorge Rúa
By mirror I mean cloning, downloading content from ansible-galaxy and
placing it into a server in your network.
This server can then expose the very same content via http/s, git protocols.
So you'll need to come up with an strategy to fetch content upstream to
your network.
After you've built your catalog of ansible items internally, you could
instruct ansible-galaxy to fetch it from your internal network instead.

This concept of air-gapped/disconnected networks applies for multiple
approaches, like distributing RPMs, container images and so on.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFtje5NWXT3dsF6nrhZy-5mDMWdufGoSk9ceihsUyT-c6BoxzQ%40mail.gmail.com.


Re: [ansible-project] [WARNING]: - linux-system-roles.network was NOT installed successfully: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/':

2021-02-02 Thread ursa Brown
when you say mirror? like this?

1. cp -r /usr/share/ansible/roles/rhel-system-roles.network   
/home/ansible/roles/

On Monday, February 1, 2021 at 2:14:09 PM UTC-6 ursa Brown wrote:

> there should be a offline flag.. 
>
> On Monday, February 1, 2021 at 10:34:11 AM UTC-6 jruar...@gmail.com wrote:
>
>> If you don't have access to the internet, then you'll have to mirror the 
>> required content into your network somehow.
>>
>> FYI: https://galaxy.ansible.com/docs/using/installing.html
>>
>> You can also consider running an Pulp instance to server ansible content 
>> too: https://github.com/pulp/pulp_ansible
>>
>> HTH,
>>
>>
>> El lun, 1 feb 2021 a las 17:19, ursa Brown () 
>> escribió:
>>
>>> How can I make ansible-galaxy work if it is not connected to internet?
>>> Thank you
>>>
>>>  ansible-galaxy role install linux-system-roles.network
>>>
>>> [WARNING]: - linux-system-roles. network was NOT installed successfully: 
>>> Unknown error when attempting to call
>>> Galaxy at 'https://galaxy.ansible.com/api/': >> Network is unreachable>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/6fd88401-14eb-4dfe-abbb-c38707754aban%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20078642-0f2d-4040-91e7-1590087e8880n%40googlegroups.com.


[ansible-project] Re: Powershell Function via Ansible | Get-AnsibleParam: Missing required argument: _raw_params

2021-02-02 Thread jesse...@gmail.com
So pulling this from docs.ansible.com 
- name: Run a command under a non-Powershell interpreter (cmd in this case) 
ansible.windows.
win_shell: echo %HOMEDIR% 
args: executable: 
cmd 
register: homedir_out 
-
That aside, following your precise example

  - ansible.windows.win_shell: echo "HI"
--begin error
ERROR! this task 'ansible.windows.win_shell' has extra params, which is 
only allowed in the following modules: script, include, meta, include_role, 
raw, set_fact, win_shell, import_tasks, group_by, import_role, shell, 
include_vars, win_command, add_host, command, include_tasks

The error appears to be in 
'/etc/ansible/playbooks/shares/greenfield/greenfield_share_create.yml': 
line 294, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  - ansible.windows.win_shell: echo "HI"
^ here
--end error

p.s, I hate google groups now.

On Monday, February 1, 2021 at 5:29:27 PM UTC-5 jbor...@gmail.com wrote:

> The win_shell and win_command modules don't support cmd as an args like 
> command/shell do. It's complaining that the raw missing is missing because 
> you haven't done 'win_shell: my command'.
> On Tuesday, February 2, 2021 at 2:40:20 AM UTC+10 jesse...@gmail.com 
> wrote:
>
>> I've got this that I'm connecting to, doing a metric ton of other things 
>> as well, so I'm positive the connection is functional and working.
>>
>> ansible 2.9.13
>>   config file = /etc/ansible/ansible.cfg
>>   configured module search path = ['/root/.ansible/plugins/modules', 
>> '/usr/share/ansible/plugins/modules']
>>   ansible python module location = 
>> /usr/local/lib/python3.6/site-packages/ansible
>>   executable location = /usr/local/bin/ansible
>>   python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 
>> 20150623 (Red Hat 4.8.5-39)]
>>
>>  Test play 
>>
>>
>> #
>>
>>   - name: test me
>> ansible.windows.win_shell:
>> args:
>>   cmd: echo 'hi'
>>
>>  Results 
>>
>> fatal: [SERVER.DOMAIN.net]: FAILED! => {
>>
>> "changed": false,
>> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
>> }
>>
>>
>>
>> On Thursday, January 28, 2021 at 2:28:41 PM UTC-5 jbor...@gmail.com 
>> wrote:
>>
>>>
>>> What Ansible version are you running, does it also fail with the same 
>>> error if you did just "- ansible.windows.win_shell: echo 'hi'". Does 
>>> win_command work, what about just "win_shell" and not the FQCN.
>>> On Friday, January 29, 2021 at 2:58:30 AM UTC+10 jesse...@gmail.com 
>>> wrote:
>>>
 Crickets
 :(

 On Wednesday, January 27, 2021 at 10:41:24 AM UTC-5 jesse...@gmail.com 
 wrote:

> Executing a rather large playbook revolving around multiple plays to 
> create shares and DFS links, etc.
>
> I've got a play to do the following.
> - 
>   - name: Create DFS links
> ansible.windows.win_shell: |
>   . C:\scripts\user\dfs_abe_func.ps1
>
>   gf-dfsadd -junction "{{ vol_junction }}" -share_name "{{ 
> share_name }}" -prd_vserver "{{ prd_vserver_fs }}.{{ fqdn }}" -dr_vserver 
> "{{ dr_vserver }}.{{ fqdn }}" -prd_state "{{ prd_state }}" -dr_state "{{ 
> dr_state }}" -rogroup "{{ rogroup }}" -rwgroup "{{ rwgroup }}" -fcgroup 
> "{{ 
> h_defaultfcgroup }}" -defaultrogroup "{{ h_defaultrogroup }}" 
> -defaultrwgroup "{{ h_defaultrwgroup }}"
> -
> Nets the below error.
>
> fatal: [Server.Domain.net]: FAILED! => {
> "changed": false,
> "msg": "Get-AnsibleParam: Missing required argument: _raw_params"
> }
>
> I'm passing a bunch of variables built within the play itself, 
> utilizing variables built from other ones, but I don't presume those are 
> related to my issues.
>
> I can post most of the PS function if needed, after its been sanitized 
> a bit.
> Looking for ideas :/
>


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0719d9f3-7194-4939-9602-6add6360b957n%40googlegroups.com.


Re: [ansible-project] List folder/files on windows

2021-02-02 Thread Stefan Hornburg (Racke)
On 2/2/21 12:13 PM, Deepak Gowda wrote:
> HI All,
> 
> I have a list of files in C:\Users\xxxuser\Downloads\ ,I am trying to find 
> out if i can pull the list of files/folders
> present in windows on the ansible node.
> 
> i have the below playbook which doesnt give any error nd doesn't give me a 
> list,
> 
> - hosts: windows
> 
>   tasks:
> 
>   - name: Find Files in Path
> 
>     win_find:
> 
>       paths: C:\Users\xxxuser\Downloads\
>       age: 2h
> 
> 

Hello Deepak,

I think you need to register the results to see the list of files:

- name: Find Files in Path
  win_find:
paths: C:\Users\xxxuser\Downloads\
age: 2h
  register: xxx_downloads

- debug:
msg: "{{ xxx_downloads.files }}"

Regards
Racke

> Thanks
> Deepak
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to
> ansible-project+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d7027f1c-152e-4818-bc48-9df08df8de47n%40googlegroups.com
> .


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76b99808-7d39-7ab0-a229-099cb645d80f%40linuxia.de.


OpenPGP_signature
Description: OpenPGP digital signature


[ansible-project] List folder/files on windows

2021-02-02 Thread Deepak Gowda
HI All,

I have a list of files in C:\Users\xxxuser\Downloads\ ,I am trying to find 
out if i can pull the list of files/folders present in windows on the 
ansible node.

i have the below playbook which doesnt give any error nd doesn't give me a 
list,

- hosts: windows

  tasks:

  - name: Find Files in Path

win_find:

  paths: C:\Users\xxxuser\Downloads\
  age: 2h


Thanks
Deepak

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d7027f1c-152e-4818-bc48-9df08df8de47n%40googlegroups.com.