Re: [ansible-project] Parallel Tasks Execution in Ansible

2018-08-06 Thread Karl Auer
One simple way is to put the tasks in separate playbooks, then:

ansible-playbook [...opts...] a.yml > a.out 2>&1 &
ansible-playbook [...opts...] b.yml > b.out 2>&1 &
ansible-playbook [...opts...] c.yml > c.out 2>&1 &
ansible-playbook [...opts...] d.yml > d.out 2>&1 &

Or if you are doing things manually, run them in separate terminals.

Regards, K.


On Tue, Aug 7, 2018 at 4:34 PM, Saurabh  wrote:

> Hi,
>
> I would like to execute parallel tasks ?
>
> Below Example
>
> - include: a.yml
>
> - include: b.yml
>
> a.yml runs and b.yml should also run,
>
> b.yml shouldn't wait for completion of a.yml.
>
> is there any way to run parallel tasks ?
>
> Thank you !
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/73c9222d-208a-4e81-ae20-94fa08fdc453%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08SsJdRi_vHVUNrGBZM4%2BXUMvReAc_tkA-gfhn280Ey2UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Parallel Tasks Execution in Ansible

2018-08-06 Thread Saurabh
Hi, 

I would like to execute parallel tasks ? 

Below Example 

- include: a.yml 

- include: b.yml 

a.yml runs and b.yml should also run, 

b.yml shouldn't wait for completion of a.yml. 

is there any way to run parallel tasks ? 

Thank you ! 

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/73c9222d-208a-4e81-ae20-94fa08fdc453%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible autofs mount

2018-08-06 Thread Karl Auer
Is this at first boot only, or at every boot?

On Tue, Aug 7, 2018 at 4:10 PM, containerkid 
wrote:

> Dear All.
> Any suggestions ?
>
> Thanks
>
>
>
>
> On Monday, August 6, 2018 at 9:04:46 PM UTC+2, containerkid wrote:
>>
>> Dear All.
>> I am working on a project where we have a scenario in which we have to
>> mount an NFS file system when each time system boots up ( we spin up using
>> AWS/GITLAB CI/CD approach) so each time when i run the pipleline i get new
>> instance with new Private ip, but my NFS( EFS in aws) will remain same and
>> the mount point also.
>>
>> Environment is as below :
>>
>> infrastructure is build in AWS via terraform
>> configuration management we are using Ansible.
>>
>> Situation is like this below :
>>
>> We have to deploy a software which is loaded in S3 bucket , when the
>> gitlab runner build the AMI we mount the NFS file system using normal way
>> of mouting using the ansible and download the binaries in the file system .
>> Once its extracted file system will umount and AWS ami creation will start.
>>
>> In the deployment phase i have to mount the file system so that RDS can
>> access will start provisioning the application environment , i think the
>> best option is autofs instead of confd ( any suggessions are welcome) but
>> if i use ansible for autofs how i can go for configuration ? i just need to
>> mount the file system during the system boot itself thats it .
>>
>>
>> Thanks
>> CK
>>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/f0c911a3-4469-4427-aa98-2070c20db3bf%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08Rj3Pz%2BGv7WN%2BVaoUz1iFe4gZV58qgzOB8Yzdq9gWkOsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible for all instance in AWS environment

2018-08-06 Thread Karl Auer
Can you access the instances at all? Using any account? Does that account
have root access or sudo privileges?

If so, then you can log in, and authorizze access to any existing account
for any public key of your choice. It dioesn't have to be the one issued by
AWS.

If you do not have access that lets you do this, then you are out of luck.
The only way forward would be (for each instance):

- stop the instance
- detach the root volume from the instance
- mount the root volume as an additional volume on another instance
- using root access on the other instance, modify the attached volume:
- add a new user to /home
- add entries to /etc/passwd, /etc/shadow and /etc/group
- make sure the new user has sudo access
- put an appropriate public key in the .ssh/authorized_keys file for
the new user
- detach the volume from the other instance
- reattach the volume to the original instance
- start the original instance

That's roughly it, anyway. None of it will work if you have encrypted the
volume, or do not have administrative access to the AWS account containing
the instance.
If the instances are being created by an ASG, then you could use the
userdata to get in to new instances. Ask if you need to know how.

Regards, K.



On Tue, Aug 7, 2018 at 4:01 PM, Ashish Gauli  wrote:

> I need to configure all AWS instances using ansible (for example install
> datadog agent), but I do not have key-pairs for each of those instances. Is
> there a way I can enable ansible-ssh without keypair?
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/df48e51c-1cd1-4cbc-9b88-844a54a1cc43%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08TZqb7g6hhD8nw8H4jPDXMyYCYwU8XTiSa2MJsjtWZ6YQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible autofs mount

2018-08-06 Thread containerkid
Dear All.
Any suggestions ? 

Thanks




On Monday, August 6, 2018 at 9:04:46 PM UTC+2, containerkid wrote:
>
> Dear All.
> I am working on a project where we have a scenario in which we have to 
> mount an NFS file system when each time system boots up ( we spin up using 
> AWS/GITLAB CI/CD approach) so each time when i run the pipleline i get new 
> instance with new Private ip, but my NFS( EFS in aws) will remain same and 
> the mount point also.
>
> Environment is as below :
>
> infrastructure is build in AWS via terraform
> configuration management we are using Ansible.
>
> Situation is like this below :
>
> We have to deploy a software which is loaded in S3 bucket , when the 
> gitlab runner build the AMI we mount the NFS file system using normal way 
> of mouting using the ansible and download the binaries in the file system . 
> Once its extracted file system will umount and AWS ami creation will start. 
>
> In the deployment phase i have to mount the file system so that RDS can 
> access will start provisioning the application environment , i think the 
> best option is autofs instead of confd ( any suggessions are welcome) but 
> if i use ansible for autofs how i can go for configuration ? i just need to 
> mount the file system during the system boot itself thats it .
>
>
> Thanks
> CK
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f0c911a3-4469-4427-aa98-2070c20db3bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible for all instance in AWS environment

2018-08-06 Thread Ashish Gauli
I need to configure all AWS instances using ansible (for example install 
datadog agent), but I do not have key-pairs for each of those instances. Is 
there a way I can enable ansible-ssh without keypair?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/df48e51c-1cd1-4cbc-9b88-844a54a1cc43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Speeding up very large playbooks

2018-08-06 Thread S C Rigler
Similar issue here (hopefully not hijacking the topic).  I have a small-ish
playbook that runs a handful of roles that distribute files, set passwords,
cron jobs, etc.  On a single host it runs in about 35 seconds.  With
Ansible 2.4 I could run it across about 1000 hosts and it would complete in
just under 30 minutes.  With Ansible 2.5 it takes 56 minutes and Ansible
2.6 it takes about 63 minutes.  A longer playbook we run nightly across the
same number of hosts in 3 and a half hours with Ansible 2.4 now takes 8 and
a half hours with 2.6.

We've resorted to tricks to speed things up such as running the playbook in
a wrapper that cuts the host list up into groups of 100 for each playbook
run (running the big playbook with free strategy on 1000 hosts is a good
way to exhaust all of the memory on our Ansible server).

Tips to identify the bottlenecks would be great.

--
Steve

On Mon, Aug 6, 2018, 6:46 PM Pshem Kowalczyk  wrote:

> Hi,
>
> We have a scenario where we pre-generate a lot of configuration on the
> controller host (targets are generally network devices, so not capable of
> running python).
> Typical generation process involves pulling data from a number odelef
> different systems (over APIs), running some local modules - mostly
> 'template'. A typical run for a single devices can have up to 500-700
> tasks.
>
> A single device can be done under 5 minutes in most cases (including
> deployment). All the generation already runs with "strategy: free". Once we
> go to bigger deployments - 10-15 devices the time that's need gets
> significantly longer (40-50 minutes is not unusual). We tried throwing CPUs
> at the problem, but it looks like only one-two CPUs get ever to 100% whilst
> the rest of them seems to be near-idle (regardless of "fork" values).
> There's plenty of RAM too (utilisation hardly ever goes over 3-4GB).
>
> Is there a way for Ansible to utilise all the CPUs? I realise this might
> not be a typical case, but we're looking now at deployments that have 30-40
> devices and waiting 3h for completion is not something we'd want to see.
>
> kind regards
> Pshem
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAEaZiRV1pLwu-F-%3D4uzx6_zOy78HaXP-XC2G634c1s66t2x3rw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFbiokdDVosUsmVOx4jYXe_BVPGWBBXET9C7xaEnHkOYBYhb_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Speeding up very large playbooks

2018-08-06 Thread Pshem Kowalczyk
Hi,

We have a scenario where we pre-generate a lot of configuration on the
controller host (targets are generally network devices, so not capable of
running python).
Typical generation process involves pulling data from a number odelef
different systems (over APIs), running some local modules - mostly
'template'. A typical run for a single devices can have up to 500-700
tasks.

A single device can be done under 5 minutes in most cases (including
deployment). All the generation already runs with "strategy: free". Once we
go to bigger deployments - 10-15 devices the time that's need gets
significantly longer (40-50 minutes is not unusual). We tried throwing CPUs
at the problem, but it looks like only one-two CPUs get ever to 100% whilst
the rest of them seems to be near-idle (regardless of "fork" values).
There's plenty of RAM too (utilisation hardly ever goes over 3-4GB).

Is there a way for Ansible to utilise all the CPUs? I realise this might
not be a typical case, but we're looking now at deployments that have 30-40
devices and waiting 3h for completion is not something we'd want to see.

kind regards
Pshem

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEaZiRV1pLwu-F-%3D4uzx6_zOy78HaXP-XC2G634c1s66t2x3rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Issue when backup cisco NXOS " fatal: [*************]: FAILED! => {"msg": "nothing to repeat"}"

2018-08-06 Thread o0tdaigle0o
Did you figure this out or get any insight? I have a similar issue running 
a simple nxos_command task.

---
- name: Check CDP State
  nxos_command:
provider: "{{ prov }}"
commands:
  - "show cdp global | include globally"
  register: capture_cdp_state

The full traceback is:
Traceback (most recent call last):
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/EGG-INFO/scripts/ansible-connection",
 
line 87, in start
self.connection._connect()
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/connection/network_cli.py",
 
line 312, in _connect
self._terminal = terminal_loader.get(network_os, self)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/loader.py",
 
line 378, in get
self._module_cache[path] = self._load_module_source(name, path)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/loader.py",
 
line 357, in _load_module_source
module = imp.load_source(full_name, path, module_file)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/terminal/nxos.py",
 
line 30, in 
class TerminalModule(TerminalBase):
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/terminal/nxos.py",
 
line 33, in TerminalModule

re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#](?:\s*)*(\x1b\S+)*$'),
  File "/usr/lib64/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
  File "/usr/lib64/python2.7/re.py", line 242, in _compile
raise error, v # invalid expression
error: nothing to repeat

fatal: [brm07-lab-5k-swi-1.us.oracle.com]: FAILED! => {
"msg": "nothing to repeat"


On Thursday, July 5, 2018 at 11:39:28 AM UTC-4, Ahmed Aljawad wrote:
>
> [nwadmin@ddcmgtnwbkp ~]$ cat AutoBackup.yml
> ---
> - name: first network playbook with when
>   connection: network_cli
>   gather_facts: false
>   hosts: SFI
>   tasks:
> - name: backup
>   nxos_config:
> backup: yes
>   register: backup_nxos_location
>   when: ansible_network_os == 'nxos'
> ...
>
> here is my -vvv
> [nwadmin@ddcmgtnwbkp ~]$ ansible-playbook AutoBackup.yml -u admin -k -vvv
> ansible-playbook 2.5.3
>   config file = /home/nwadmin/ansible.cfg
>   configured module search path = 
> [u'/home/nwadmin/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.6/site-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.6.6 (r266:84292, Aug 18 2016, 08:36:59) [GCC 4.4.7 
> 20120313 (Red Hat 4.4.7-17)]
> Using /home/nwadmin/ansible.cfg as config file
> [DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as 
> it can also be a list of hosts, a directory or a list of paths , use 
> [defaults]
> inventory=/path/to/file|dir instead. This feature will be removed in 
> version 2.8. Deprecation warnings can be disabled by setting
> deprecation_warnings=False in ansible.cfg.
> SSH password:
> Parsed /home/nwadmin/INV_LIST inventory source with ini plugin
>
> PLAYBOOK: AutoBackup.yml 
> ***
> 1 plays in AutoBackup.yml
>
> PLAY [first network playbook with when] 
> 
> META: ran handlers
>
> TASK [backup] 
> **
> task path: /home/nwadmin/AutoBackup.yml:7
> The full traceback is:
> Traceback (most recent call last):
>   File "/usr/bin/ansible-connection", line 87, in start
> self.connection._connect()
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/connection/network_cli.py", 
> line 306, in _connect
> self._terminal = terminal_loader.get(network_os, self)
>   File "/usr/lib/python2.6/site-packages/ansible/plugins/loader.py", line 
> 366, in get
>
> return _compile(pattern, flags)
>   File "/usr/lib64/python2.6/re.py", line 245, in _compile
> raise error, v # invalid expression
> error: nothing to repeat
>  self._module_cache[path] = self._load_module_source(name, path)
>   File "/usr/lib/python2.6/site-packages/ansible/plugins/loader.py", line 
> 345, in _load_module_source
> module = imp.load_source(full_name, path, module_file)
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/terminal/nxos.py", line 
> 30, in 
> class TerminalModule(TerminalBase):
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/terminal/nxos.py", line 
> 33, in TerminalModule
> 
> re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)*(\x1b\S+)*$'),
>   File "/usr/lib64/python2.6/re.py", line 190, in compile
>
>
>

-- 
You received this message

[ansible-project] Re: Collect Azure VM facts

2018-08-06 Thread Jordan Borean
A VM facts module was just added to the codebase and will be available in 
the 2.7 release by default. What you can do is create a copy of the file as 
is and store it in the library folder of the role or next to the playbook 
and access it like normal 
(https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_facts.py).
 
If you do want to go down that route, I recommend you call the module 
something like azure_rm_virtualmachine_facts_cust to make it explicitly 
clear you are using a version that is not built into Ansible. This means 
that when you do upgrade to 2.7 or future versions you don't override the 
builtin one which by that time may contain bug fixes or newer features.

Thanks

Jordan

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/39071b34-02dd-4461-bff5-80dd5beaa7bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible autofs mount

2018-08-06 Thread containerkid
Dear All.
I am working on a project where we have a scenario in which we have to 
mount an NFS file system when each time system boots up ( we spin up using 
AWS/GITLAB CI/CD approach) so each time when i run the pipleline i get new 
instance with new Private ip, but my NFS( EFS in aws) will remain same and 
the mount point also.

Environment is as below :

infrastructure is build in AWS via terraform
configuration management we are using Ansible.

Situation is like this below :

We have to deploy a software which is loaded in S3 bucket , when the gitlab 
runner build the AMI we mount the NFS file system using normal way of 
mouting using the ansible and download the binaries in the file system . 
Once its extracted file system will umount and AWS ami creation will start. 

In the deployment phase i have to mount the file system so that RDS can 
access will start provisioning the application environment , i think the 
best option is autofs instead of confd ( any suggessions are welcome) but 
if i use ansible for autofs how i can go for configuration ? i just need to 
mount the file system during the system boot itself thats it .


Thanks
CK

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7470c14e-1e3f-44a0-9eef-885b650006e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 20:01, Kai Stian Olstad wrote:

On 06.08.2018 19:02, eric.b.hymow...@nasa.gov wrote:
I don't know how to take a discussion from the list to a private 
email...

but the problem with setting up ssh bastion hosts is not ansible
configuration or ssh configuration, it's poorly-designed security 
protocols

that interfere with well-configured machines.

... unless you know of a way that I can set up my group_vars file to 
use

ansible_user: $SUDO_USER


The variable should be from localhost?
If so this should work

ansible_user: "{{ lookup('pipe', 'echo $SUDO_USER') }}"


There is even an environment lookup plugin

ansible_user: "{{ lookup('env', 'SUDO_USER') }}"

--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/168a2c7e0f8c8afc710e73d77da07bab%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 19:02, eric.b.hymow...@nasa.gov wrote:
I don't know how to take a discussion from the list to a private 
email...

but the problem with setting up ssh bastion hosts is not ansible
configuration or ssh configuration, it's poorly-designed security 
protocols

that interfere with well-configured machines.

... unless you know of a way that I can set up my group_vars file to 
use

ansible_user: $SUDO_USER


The variable should be from localhost?
If so this should work

ansible_user: "{{ lookup('pipe', 'echo $SUDO_USER') }}"

--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/da313f60b85da09724392c58efd22fcf%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Collect Azure VM facts

2018-08-06 Thread Matin Nayob
Hi there,

Is there a way to gather facts about the state of an Azure VM?

There exist fact gathering modules for other Azure resources (such as 
a azure_rm_virtualmachineimage_facts) but there doesn't seem to be any for 
VMs.
What I am trying to do is run sysprep on a Windows VM, then have ansible 
wait until its in a Stopped state, before trying to capture it.

An option is to just run the Azure cli, however I was hoping there may be a 
better way.

Any thoughts?

Thanks,
Matin

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4c668368-98f6-4e8e-8f59-9e22333f50f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread eric . b . hymowitz
I don't know how to take a discussion from the list to a private email...  
but the problem with setting up ssh bastion hosts is not ansible 
configuration or ssh configuration, it's poorly-designed security protocols 
that interfere with well-configured machines.

... unless you know of a way that I can set up my group_vars file to use
ansible_user: $SUDO_USER

...which I cannot get working.

On Monday, August 6, 2018 at 10:37:12 AM UTC-4, Kai Stian Olstad wrote:
>
> On 06.08.2018 16:29, eric.b@nasa.gov  wrote: 
> > I had trouble setting up an ssh-proxy the last time I tried, but I 
> > don't 
> > remember why exactly.  I should look into it again. 
> > 
> > That is ... a fascinating idea. One I will definitely need to look into 
> > (and check with my boss about). 
>
> If you go this route, this blog post could help in setting it up 
>
> https://blog.scottlowe.org/2015/12/24/running-ansible-through-ssh-bastion-host/
>  
>
> -- 
> Kai Stian Olstad 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ae778e77-9439-4dc6-8cd6-fe795f0468f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 16:55, christian.tre...@itsv.at wrote:

yes, this is because ansible is sending garbage down the stream.
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py" "group", 
"-U", "-n", "LNZ"

while the script expects this
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group  -U  -n  
LNZ"


This is not garbage, it's just how it's.

$ cat playbook.yml
---
- hosts: cb
  gather_facts: no
  tasks:
 - command: echo It is just how it works
   delegate_to: localhost


$ ansible-playbook playbook.yml -v

PLAY [cb] **

TASK [command] *
changed: [cb -> localhost] => {
"changed": true,
"cmd": [
"echo",
"It",
"is",
"just",
"how",
"it",
"works"
],
"delta": "0:00:00.001215",
"end": "2018-08-06 17:48:26.274927",
"rc": 0,
"start": "2018-08-06 17:48:26.273712"
}

STDOUT:

It is just how it works


PLAY RECAP *
cb : ok=1changed=1unreachable=0failed=0

--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/813e009885158fe3afb2ddbb36ea3fcc%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Remove CA in Bundle CA via Playbook

2018-08-06 Thread Vincent Descargues
My bad i find solution > update-ca-trust  > replace en remove CA in CA 
Bundle
Cya :)

Le lundi 6 août 2018 15:11:14 UTC+2, Vincent Descargues a écrit :
>
> That's my problem, it's pretty simple, I think. I wish I could delete a CA 
> in a CA Bundle with one command
> For example :
> My CA bundle :
>
> 1° CA
> 2° CA
> 3° CA 
> 4° CA
>
> And I just want to delete the 2nd certificate
> Currently
>
> ---
> - name: Copy crt
>   hosts: servertest
>   sudo: yes
>   become_method: su
>   remote_user: root
>   tasks:
>  - name: Copy adlds.crt
>copy:
>  src: /etc/ansible/crt/adlds.crt
>  dest: /etc/pki/ca-trust/source/anchors/
>  - name: Enable update-ca-trust
>shell: /usr/bin/update-ca-trust enable
>  - name: Extract certificates
>shell: update-ca-trust
>  - name: Delete old CA
>shell: 
>
>
> I know how to implement a certificate in CA bundle now I would just like 
> to delete one (the old certificate), maybe with rm but it is bundle and so 
> i can't.
>
> Thx for answers :)
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/93880c13-842d-4568-9e11-8486d4258b14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
What happens when you run that script, with those parameters, yourself,
manually? On the same host as Ansible is running it on.

On Tue, Aug 7, 2018 at 12:55 AM,  wrote:

> yes, this is because ansible is sending garbage down the stream.
> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py" "group", "-U",
> "-n", "LNZ" while the script expects this 
> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py
> group  -U  -n  LNZ"
>
> On Monday, August 6, 2018 at 4:48:18 PM UTC+2, Karl Auer wrote:
>>
>> Well, amazingly enough this is progress!
>>
>> Your script is now running. The garbage you see is a python stack trace,
>> because the program had a problem - but it did run.
>>
>> I don't know what that script does, but from the error message it was
>> parsing some file or other and was unable to find a section called "server".
>>
>> Regards, K.
>>
>>
>> On Tue, Aug 7, 2018 at 12:40 AM,  wrote:
>>
>>> modified accordingly, using delegate_to, outcome is even worse. the
>>> command completly garbled. i can not imagine why it is this hard to run a
>>> simple command with arguments.  just "/etc/ansible/aix/roles/hostgroups/
>>> files/inventoryctl.py group -U -n LNZ" without any fuss or specials.
>>>
>>>
>>>
>>> TASK [hostgroups : command] **
>>> 
>>> 
>>> *
>>> changed: [AMTEST1 -> localhost] => (item=pwd)
>>> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
>>> files/inventoryctl.py group -U -n LNZ) => {"changed": true, "cmd": [
>>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "group", "-U"
>>> , "-n", "LNZ"], "delta": "0:00:00.109754", "end": "2018-08-06
>>> 16:36:54.041377", "item": 
>>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py
>>> group -U -n LNZ", "msg": "non-zero return code", "rc": 1, "start": 
>>> "2018-08-06
>>> 16:36:53.931623", "stderr": "Traceback (most recent call last):\n  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549,
>>> in \nInventoryCtl()\n  File 
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\",
>>> line 31, in __init__\nself.read_settings()\n  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42,
>>> in read_settings\nself.myconfig = dict(config.items('server'))\n  File
>>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
>>> line 869, in items\nraise NoSectionError(section)\nbackp
>>> orts.configparser.NoSectionError: No section: 'server'", "stderr_lines":
>>> ["Traceback (most recent call last):", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549,
>>> in ", "InventoryCtl()", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31,
>>> in __init__", "self.read_settings()", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42,
>>> in read_settings", "self.myconfig = dict(config.items('server'))", "
>>>  File 
>>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
>>> line 869, in items", "raise NoSectionError(section)",
>>> "backports.configparser.NoSectionError: No section: 'server'"], "stdout"
>>> : "", "stdout_lines": []}
>>> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
>>> files/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": true,
>>> "cmd": ["/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py",
>>> "host", "-U", "-H", "AMTEST1", "-g", "LNZ"], "delta": "0:00:00.109299",
>>> "end": "2018-08-06 16:36:54.289337", "item":
>>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py host -U -H
>>> AMTEST1 -g LNZ", "msg": "non-zero return code", "rc": 1, "start": 
>>> "2018-08-06
>>> 16:36:54.180038", "stderr": "Traceback (most recent call last):\n  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549,
>>> in \nInventoryCtl()\n  File 
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\",
>>> line 31, in __init__\nself.read_settings()\n  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42,
>>> in read_settings\nself.myconfig = dict(config.items('server'))\n  File
>>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
>>> line 869, in items\nraise NoSectionError(section)\nbackp
>>> orts.configparser.NoSectionError: No section: 'server'", "stderr_lines":
>>> ["Traceback (most recent call last):", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549,
>>> in ", "InventoryCtl()", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31,
>>> in __init__", "self.read_settings()", "  File
>>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42,
>>> in read_settings", "self.myconfig = dict(config.items('server'))", "
>>>

Re: [ansible-project] running ptython script in role

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 16:40, christian.tre...@itsv.at wrote:
modified accordingly, using delegate_to, outcome is even worse. the 
command
completly garbled. i can not imagine why it is this hard to run a 
simple

command with arguments.  just "/etc/ansible/aix/roles/hostgroups/files/
inventoryctl.py group -U -n LNZ" without any fuss or specials.


As Karl said, this is progress since Ansible running you command.

You would do yourself(and us) a big favor by setting

  stdout_callback = debug

in ansible.cfg under the [default] section, this will give you a much 
nicer output.



--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7386a9d2f08887d32bc302a37e55cefb%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
yes, this is because ansible is sending garbage down the stream. 
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py" "group", "-U", 
"-n", "LNZ" while the script expects this 
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group  -U  -n  LNZ"

On Monday, August 6, 2018 at 4:48:18 PM UTC+2, Karl Auer wrote:
>
> Well, amazingly enough this is progress!
>
> Your script is now running. The garbage you see is a python stack trace, 
> because the program had a problem - but it did run.
>
> I don't know what that script does, but from the error message it was 
> parsing some file or other and was unable to find a section called "server".
>
> Regards, K.
>
>
> On Tue, Aug 7, 2018 at 12:40 AM, > 
> wrote:
>
>> modified accordingly, using delegate_to, outcome is even worse. the 
>> command completly garbled. i can not imagine why it is this hard to run a 
>> simple command with arguments.  just "/etc/ansible/aix/roles/hostgroups/
>> files/inventoryctl.py group -U -n LNZ" without any fuss or specials.
>>
>>
>>
>> TASK [hostgroups : command] 
>> ***
>> changed: [AMTEST1 -> localhost] => (item=pwd)
>> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
>> files/inventoryctl.py group -U -n LNZ) => {"changed": true, "cmd": [
>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "group", "-U", 
>> "-n", "LNZ"], "delta": "0:00:00.109754", "end": "2018-08-06 
>> 16:36:54.041377", "item": 
>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
>> group -U -n LNZ", "msg": "non-zero return code", "rc": 1, "start": 
>> "2018-08-06 
>> 16:36:53.931623", "stderr": "Traceback (most recent call last):\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
>> \nInventoryCtl()\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
>> __init__\nself.read_settings()\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
>> read_settings\nself.myconfig = dict(config.items('server'))\n  File 
>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
>> line 869, in items\nraise 
>> NoSectionError(section)\nbackports.configparser.NoSectionError: No section: 
>> 'server'", "stderr_lines": ["Traceback (most recent call last):", " 
>>  File \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 
>> 549, in ", "InventoryCtl()", "  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
>> __init__", "self.read_settings()", "  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
>> read_settings", "self.myconfig = dict(config.items('server'))", " 
>>  File 
>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
>> line 869, in items", "raise NoSectionError(section)", 
>> "backports.configparser.NoSectionError: 
>> No section: 'server'"], "stdout": "", "stdout_lines": []}
>> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
>> files/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": true, 
>> "cmd": ["/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "host"
>> , "-U", "-H", "AMTEST1", "-g", "LNZ"], "delta": "0:00:00.109299", "end": 
>> "2018-08-06 
>> 16:36:54.289337", "item": 
>> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
>> host -U -H AMTEST1 -g LNZ", "msg": "non-zero return code", "rc": 1, 
>> "start": "2018-08-06 16:36:54.180038", "stderr": "Traceback (most recent 
>> call last):\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
>> \nInventoryCtl()\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
>> __init__\nself.read_settings()\n  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
>> read_settings\nself.myconfig = dict(config.items('server'))\n  File 
>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
>> line 869, in items\nraise 
>> NoSectionError(section)\nbackports.configparser.NoSectionError: No section: 
>> 'server'", "stderr_lines": ["Traceback (most recent call last):", " 
>>  File \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 
>> 549, in ", "InventoryCtl()", "  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
>> __init__", "self.read_settings()", "  File 
>> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
>> read_settings", "self.myconfig = dict(config.items('server'))", " 
>>  File 
>> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
>> line 869, in items", "raise NoSectionError(section)", 
>> "backports.configparser.NoSectionError: 
>> No section: 'server'"], "

Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
Well, amazingly enough this is progress!

Your script is now running. The garbage you see is a python stack trace,
because the program had a problem - but it did run.

I don't know what that script does, but from the error message it was
parsing some file or other and was unable to find a section called "server".

Regards, K.


On Tue, Aug 7, 2018 at 12:40 AM,  wrote:

> modified accordingly, using delegate_to, outcome is even worse. the
> command completly garbled. i can not imagine why it is this hard to run a
> simple command with arguments.  just "/etc/ansible/aix/roles/hostgroups/
> files/inventoryctl.py group -U -n LNZ" without any fuss or specials.
>
>
>
> TASK [hostgroups : command] **
> 
> 
> *
> changed: [AMTEST1 -> localhost] => (item=pwd)
> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
> files/inventoryctl.py group -U -n LNZ) => {"changed": true, "cmd": [
> "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "group", "-U",
> "-n", "LNZ"], "delta": "0:00:00.109754", "end": "2018-08-06
> 16:36:54.041377", "item": "/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py group -U -n LNZ", "msg": "non-zero
> return code", "rc": 1, "start": "2018-08-06 16:36:53.931623", "stderr": 
> "Traceback
> (most recent call last):\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 549, in \n
>  InventoryCtl()\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 31, in __init__\n
>  self.read_settings()\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 42, in read_settings\n
>  self.myconfig = dict(config.items('server'))\n  File
> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
> line 869, in items\nraise NoSectionError(section)\
> nbackports.configparser.NoSectionError: No section: 'server'",
> "stderr_lines": ["Traceback (most recent call last):", "  File
> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in
> ", "InventoryCtl()", "  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 31, in __init__", "
>  self.read_settings()", "  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 42, in read_settings", "
>  self.myconfig = dict(config.items('server'))", "  File
> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
> line 869, in items", "raise NoSectionError(section)",
> "backports.configparser.NoSectionError: No section: 'server'"], "stdout":
> "", "stdout_lines": []}
> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
> files/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": true,
> "cmd": ["/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "host",
> "-U", "-H", "AMTEST1", "-g", "LNZ"], "delta": "0:00:00.109299", "end": 
> "2018-08-06
> 16:36:54.289337", "item": "/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "non-zero
> return code", "rc": 1, "start": "2018-08-06 16:36:54.180038", "stderr": 
> "Traceback
> (most recent call last):\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 549, in \n
>  InventoryCtl()\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 31, in __init__\n
>  self.read_settings()\n  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 42, in read_settings\n
>  self.myconfig = dict(config.items('server'))\n  File
> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
> line 869, in items\nraise NoSectionError(section)\
> nbackports.configparser.NoSectionError: No section: 'server'",
> "stderr_lines": ["Traceback (most recent call last):", "  File
> \"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in
> ", "InventoryCtl()", "  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 31, in __init__", "
>  self.read_settings()", "  File \"/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py\", line 42, in read_settings", "
>  self.myconfig = dict(config.items('server'))", "  File
> \"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\",
> line 869, in items", "raise NoSectionError(section)",
> "backports.configparser.NoSectionError: No section: 'server'"], "stdout":
> "", "stdout_lines": []}
>
>
>
>
> On Monday, August 6, 2018 at 4:21:51 PM UTC+2, Kai Stian Olstad wrote:
>>
>> On 06.08.2018 16:08, christia...@itsv.at wrote:
>> > even using {{ role_path}} does not work, this slowly is getting out of
>> > hand...
>> >
>> > - local_action: command "{{ item }}"
>>
>> I think the quotes inn here is your problem, try removing them.
>>
>>
>> >   with_items:
>> >   - "pwd"
>> >   - "{{ role_path }}/files/inventoryctl.py group

Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
modified accordingly, using delegate_to, outcome is even worse. the command 
completly garbled. i can not imagine why it is this hard to run a simple 
command with arguments.  just "/etc/ansible/aix/roles/hostgroups/files/
inventoryctl.py group -U -n LNZ" without any fuss or specials.



TASK [hostgroups : command] 
***
changed: [AMTEST1 -> localhost] => (item=pwd)
failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/files
/inventoryctl.py group -U -n LNZ) => {"changed": true, "cmd": [
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "group", "-U", 
"-n", "LNZ"], "delta": "0:00:00.109754", "end": "2018-08-06 16:36:54.041377"
, "item": "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group -U 
-n LNZ", "msg": "non-zero return code", "rc": 1, "start": "2018-08-06 
16:36:53.931623", "stderr": "Traceback (most recent call last):\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
\nInventoryCtl()\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
__init__\nself.read_settings()\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
read_settings\nself.myconfig = dict(config.items('server'))\n  File 
\"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
line 869, in items\nraise 
NoSectionError(section)\nbackports.configparser.NoSectionError: No section: 
'server'", "stderr_lines": ["Traceback (most recent call last):", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
", "InventoryCtl()", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
__init__", "self.read_settings()", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
read_settings", "self.myconfig = dict(config.items('server'))", "  File 
\"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
line 869, in items", "raise NoSectionError(section)", 
"backports.configparser.NoSectionError: 
No section: 'server'"], "stdout": "", "stdout_lines": []}
failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/files
/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": true, "cmd": [
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py", "host", "-U", 
"-H", "AMTEST1", "-g", "LNZ"], "delta": "0:00:00.109299", "end": "2018-08-06 
16:36:54.289337", "item": 
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ", "msg": "non-zero return code", "rc": 1, "start": 
"2018-08-06 
16:36:54.180038", "stderr": "Traceback (most recent call last):\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
\nInventoryCtl()\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
__init__\nself.read_settings()\n  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
read_settings\nself.myconfig = dict(config.items('server'))\n  File 
\"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
line 869, in items\nraise 
NoSectionError(section)\nbackports.configparser.NoSectionError: No section: 
'server'", "stderr_lines": ["Traceback (most recent call last):", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 549, in 
", "InventoryCtl()", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 31, in 
__init__", "self.read_settings()", "  File 
\"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py\", line 42, in 
read_settings", "self.myconfig = dict(config.items('server'))", "  File 
\"/usr/lib/python2.7/site-packages/backports/configparser/__init__.py\", 
line 869, in items", "raise NoSectionError(section)", 
"backports.configparser.NoSectionError: 
No section: 'server'"], "stdout": "", "stdout_lines": []}




On Monday, August 6, 2018 at 4:21:51 PM UTC+2, Kai Stian Olstad wrote:
>
> On 06.08.2018 16:08, christia...@itsv.at  wrote: 
> > even using {{ role_path}} does not work, this slowly is getting out of 
> > hand... 
> > 
> > - local_action: command "{{ item }}" 
>
> I think the quotes inn here is your problem, try removing them. 
>
>
> >   with_items: 
> >   - "pwd" 
> >   - "{{ role_path }}/files/inventoryctl.py group -U -n LNZ" 
> >   - "{{ role_path }}/files/inventoryctl.py host -U -H {{ 
> > inventory_hostname }} -g LNZ" 
> >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6DX") 
> > 
> > 
> > TASK [hostgroups : command] 
> > 
> 

Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 16:29, eric.b.hymow...@nasa.gov wrote:
I had trouble setting up an ssh-proxy the last time I tried, but I 
don't

remember why exactly.  I should look into it again.

That is ... a fascinating idea. One I will definitely need to look into
(and check with my boss about).


If you go this route, this blog post could help in setting it up
https://blog.scottlowe.org/2015/12/24/running-ansible-through-ssh-bastion-host/

--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a1879b73e867fa2c656b94d363ac7a4d%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Trouble with ec2_vpc_vgw

2018-08-06 Thread Karl Auer
Let us know when you've tried it...

On Mon, Aug 6, 2018 at 11:30 PM,  wrote:

> My reasoning on that was that I don't need to set up a whole VPN
> connection. It's already set up. I just need to attach the VPC to the
> gateway.
>
> But maybe you're right. It's hard to tell from the documentation on
> docs.ansible.com.
>
> --
> Todd
>
>
> On Friday, August 3, 2018 at 6:31:16 PM UTC-4, Karl Auer wrote:
>>
>> I have not tried this myself, but it occurs to me that maybe you should
>> be using ec2_vpc_vpn to modify the VPN's gateway, rather than using
>> ec2_vpc_vgw to modify the gateway's VPN.
>>
>> That is, don't think of it as attaching a VPN to a gateway, think of it
>> as associating a gateway with a VPN.
>>
>> BTW, name is a parameter for a gateway, though not for a VPN.
>>
>> Regards, K.
>>
>>
>> On Sat, Aug 4, 2018 at 2:35 AM,  wrote:
>>
>>> I am trying to run ec2_vpc_vgw just to attach a vpc to a vgw (virtual
>>> private gateway). The vgw and vpc both already exist. I don't need to
>>> create them. Here's what I run:
>>>
>>> - name: attach vpc to virtual private gateway
>>>   ec2_vpc_vgw:
>>> region: "{{ openshift_aws_region }}"
>>> vpc_id: "{{ vpcout.vpcs[0].id }}"
>>> vpn_gateway_id: "{{ openshift_aws_vgw_id }}"
>>>
>>> Here is an error that results:
>>>
>>> fatal: [localhost]: FAILED! => {
>>> "changed": false,
>>> "invocation": {
>>> "module_args": {
>>> "region": "us-east-1",
>>> "state": "present",
>>> "type": "ipsec.1",
>>> "validate_certs": true,
>>> "vpc_id": "vpc-427cb738",
>>> "vpn_gateway_id": "vgw-ff0ffe96",
>>> "wait_timeout": 320
>>> }
>>> },
>>> "msg": "state is present but all of the following are missing: name"
>>> }
>>>
>>> The Ansible modules documentation doesn't say that name is required. And
>>> in this scenario name shouldn't matter anyway, I'm giving it the specific
>>> vgw I want to attach to. The documentation examples don't give an example
>>> of just attaching an existing vpc to an existing vgw. It only has examples
>>> for creating a new vgw or deleting one. So it's no help.
>>>
>>> Anyone know what's going on here? How do I attach an existing vpc to an
>>> existing vgw?
>>>
>>> --
>>> Todd
>>>
>>> --
>>> 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 post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/ansible-project/d5b93425-0366-46a8-bbc9-c06b698dd5ae%
>>> 40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Karl Auer
>>
>> Email  : ka...@2pisoftware.com
>> Website: http://2pisoftware.com
>>
>> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
>> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/0726-1ceb-4d2d-bb6d-81f57f635f5c%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08R_rSk8LbwR8aRMDXA8-Rhv9G-FJ3kup8JpFYtr5NsRew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread eric . b . hymowitz
On Monday, August 6, 2018 at 10:09:33 AM UTC-4, Kai Stian Olstad wrote:
>
> On 06.08.2018 15:44, eric.b@nasa.gov  wrote: 
> > I have two ansible servers, call them ansible-a and ansible-b . 
> > ansible-a is my "primary" most-often-used ansible server for most of my 
> > hosts including ansible-b.  However, there is a segregated network that 
> > ansible-a cannot get to, so ansible-b is the ansible server for those 
> > hosts on that network. 
>
> You could use ansible-b as a ssh proxy/bastion and have all the ansible 
> configuration on ansible-a. 
> Then when ansible-a need to contact host on the segregated network the 
> connection would be proxy-ed through a ansible-b. 
>

I had trouble setting up an ssh-proxy the last time I tried, but I don't 
remember why exactly.  I should look into it again.

That is ... a fascinating idea. One I will definitely need to look into 
(and check with my boss about).
 

> To make the dynamic inventory you could do this 
>
> #!/bin/bash 
>
> ssh @ansible-a "cd /path/to/the/ansible/configuration; 
> ansible-inventory all --list
>

Shortly after I posted my question, i found the ansible-inventory program 
which I think is exactly what I need in either case.

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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/262ced2d-3b3f-40f9-84c6-e78ed8449558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 16:08, christian.tre...@itsv.at wrote:

even using {{ role_path}} does not work, this slowly is getting out of
hand...

- local_action: command "{{ item }}"


I think the quotes inn here is your problem, try removing them.



  with_items:
  - "pwd"
  - "{{ role_path }}/files/inventoryctl.py group -U -n LNZ"
  - "{{ role_path }}/files/inventoryctl.py host -U -H {{
inventory_hostname }} -g LNZ"
  when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
(itsv_machine_serial.stdout is match "IBM,02781A6CX") or
(itsv_machine_serial.stdout is match "IBM,02781A6DX")


TASK [hostgroups : command]
***
changed: [AMTEST1 -> localhost] => (item=pwd)
failed: [AMTEST1 -> localhost] 
(item=/etc/ansible/aix/roles/hostgroups/files

/inventoryctl.py group -U -n LNZ) => {"changed": false, "cmd":
"'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group -U -n 
LNZ'", "item":


Because of the quotes above you item is
'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group -U -n 
LNZ'


But it need to be without the single quotes, and they are there because 
of the double quotes in the local_action.



You could avoid problems like this by dropping local_action and use 
delegate_to instead.


  - command: "{{ item }}"
delegate_to: localhost
with_items:
  - "pwd"
  - "{{ role_path }}/files/inventoryctl.py group -U -n LNZ"
  - "{{ role_path }}/files/inventoryctl.py host -U -H {{ 
inventory_hostname }} -g LNZ"

when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
  (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
  (itsv_machine_serial.stdout is match "IBM,02781A6DX")


--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3f362728eac086b1a05a46a330fe40ba%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
Hm.

I haven't used command much myself, but I think you have to give it
space-delimited commands.

Could it be that you are actually telling Ansible to execute a command
called "inventoryctl.py host -U -H AMTEST1 -g LNZ", rather than a command
called "inventoryctl.py" with arguments "host", "-U', "-H", "AMTEST1",
"-g", and "LNZ" ?!?

Not sure how to fix that.

Regards, K.


On Tue, Aug 7, 2018 at 12:08 AM,  wrote:

> even using {{ role_path}} does not work, this slowly is getting out of
> hand...
>
> - local_action: command "{{ item }}"
>   with_items:
>   - "pwd"
>   - "{{ role_path }}/files/inventoryctl.py group -U -n LNZ"
>   - "{{ role_path }}/files/inventoryctl.py host -U -H {{
> inventory_hostname }} -g LNZ"
>   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6DX")
>
>
> TASK [hostgroups : command] **
> 
> 
> *
> changed: [AMTEST1 -> localhost] => (item=pwd)
> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
> files/inventoryctl.py group -U -n LNZ) => {"changed": false, "cmd":
> "'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py group -U -n
> LNZ'", "item": "/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py
> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/
> files/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": false,
> "cmd": "'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py host -U
> -H AMTEST1 -g LNZ'", "item": "/etc/ansible/aix/roles/
> hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno
> 2] No such file or directory", "rc": 2}
>
>
>
>
>
> On Monday, August 6, 2018 at 3:47:56 PM UTC+2, christia...@itsv.at wrote:
>>
>> ---
>> # tasks file for hostgroups
>> - shell: /usr/bin/uname -L | cut -d ' ' -f2
>>   register: itsv_lparname
>>
>> - command: /usr/sbin/lsattr -El sys0 -a systemid -F value
>>   register: itsv_machine_serial
>>
>> - command: pwd
>>
>> - local_action: command "{{ item }}"
>>   with_items:
>>   - "pwd"
>>   - "inventoryctl.py group -U -n LNZ"
>>   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g LNZ"
>>   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
>> (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
>> (itsv_machine_serial.stdout is match "IBM,02781A6DX")
>>
>>
>> output:
>>
>> root@lpgaixmgmtlx01:/etc/ansible/aix>ansible-playbook -i AMTEST1,
>> testplay.yml
>>
>> PLAY [run test play] **
>> 
>> 
>> 
>>
>> TASK [hostgroups : shell] **
>> 
>> 
>> ***
>> changed: [AMTEST1]
>>
>> TASK [hostgroups : command] **
>> 
>> 
>> *
>> changed: [AMTEST1]
>>
>> TASK [hostgroups : command] **
>> 
>> 
>> *
>> changed: [AMTEST1]
>>
>> TASK [hostgroups : command] **
>> 
>> 
>> *
>> changed: [AMTEST1 -> localhost] => (item=pwd)
>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) =>
>> {"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
>> "inventoryctl.py
>> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g
>> LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1
>> -g LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno
>> 2] No such file or directory", "rc": 2}
>>
>> PLAY RECAP 
>> 
>> 
>> 
>> AMTEST1: ok=3changed=3unreachable=0failed
>> =1
>>
>>
>>
>>
>>
>> On Monday, August 6, 2018 at 3:36:11 PM UTC+2, Karl Auer wrote:
>>>
>>> When stuff doesn

Re: [ansible-project] Re: Help me to install ansible - end up with "Oops! An error occured while running setup"

2018-08-06 Thread Alexsey S
 build shell scripts to execute playbooks on ansible-b and run them from
ansible-a??

On Mon, Aug 6, 2018 at 9:48 AM Timothy Vigers 
wrote:

> Hi Vicky,
>
> Sorry I only just saw this...
>
> I can't really remember but I think it was the database password I had
> configured.
>
> Regards,
>
> Tim
>
> On Thursday, 10 August 2017 00:22:01 UTC+10, Vicky Korpal wrote:
>>
>> Hi @Timothy
>>
>> Which password are you talking about ? I am having the same issue and
>> cant find the reason. Thanks in advance
>>
>> On Monday, 20 February 2017 10:48:15 UTC-6, Timothy Vigers wrote:
>>>
>>> Hi Ben,
>>>
>>> Not sure if you ended up fixing it however I had the same issue.
>>>
>>> It was because of the password that I had set.
>>>
>>> Regards,
>>>
>>> Tim
>>>
>>> On Friday, 23 December 2016 04:26:25 UTC+11, Ben .T.George wrote:

 HI

 i am very new to ansible and i want to setup a POC env for my company.

 i was following
 http://docs.ansible.com/ansible-tower/latest/html/quickinstall/install_script.html
  and
 while running seup, i am getting "[error] Oops!  An error occured while
 running setup."

 and below is the error on log file


 ASK [awx_install : Wait for supervisor to stop.]
 **
 ^[[0;32mok: [localhost] => {"attempts": 1, "changed": false, "stat":
 {"exists": false}}^[[0m

 TASK [awx_install : Migrate the Tower database schema (may take awhile
 when upgrading).] ***
 ^[[0;31mfatal: [localhost]: FAILED! => {"changed": true, "cmd":
 ["tower-manage", "migrate", "--noinput", "--fake-initial"], "delta":
 "0:00:01.327536", "end": "2016-12-21 11:40:18.293455", "failed": true,
 "rc": 1, "start": "2016-12-21 11:40:16.965919", "stderr": "Traceback (most
 recent call last):\n  File \"/usr/bin/tower-manage\", line 9, in \n
load_entry_point('ansible-tower==3.0.3', 'console_scripts',
 'tower-manage')()\n  File \"/lib/python2.7/site-packages/awx/__init__.py\",
 line 103, in manage\n  File
 \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\",
 line 354, in execute_from_command_line\nutility.execute()\n  File
 \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\",
 line 328, in execute\ndjango.setup()\n  File
 \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/__init__.py\",
 line 18, in setup\napps.populate(settings.INSTALLED_APPS)\n  File
 \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/apps/registry.py\",
 line 108, in populate\napp_config.import_models(all_models)\n  File
 \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/apps/config.py\",
 line 198, in import_models\nself.models_module =
 import_module(models_module_name)\n  File
 \"/opt/rh/python27/root/usr/lib64/python2.7/importlib/__init__.py\", line
 37, in import_module\n__import__(name)\n  File
 \"/lib/python2.7/site-packages/awx/main/models/__init__.py\", line 79, in
 \n  File \"/lib/python2.7/site-packages/awx/main/signals.py\", line
 23, in \n  File \"/lib/python2.7/site-packages/awx/main/tasks.py\",
 line 50, in \n  File
 \"/lib/python2.7/site-packages/awx/main/queue.py\", line 26, in
 \nValueError: too many values to unpack", "stdout": "",
 "stdout_lines": [], "warnings": []}^[[0m

 RUNNING HANDLER [supervisor : restart supervisor]
 **

 RUNNING HANDLER [httpd : restart httpd]
 
 to retry, use: --limit
 @/root/Desktop/ansible-tower-setup-3.0.3/install.retry

 PLAY RECAP
 *
 ^[[0;31mlocalhost^[[0m  : ^[[0;32mok=87  ^[[0m
 ^[[0;33mchanged=35  ^[[0m unreachable=0^[[0;31mfailed=1   ^[[0m



 how can i fix this issue.

 Regards,
 Ben

>>> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f65fce82-70ff-483e-b1f1-d674432b547e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thank you,
Alexsey Sapozhnikov

-- 
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

Re: [ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread Kai Stian Olstad

On 06.08.2018 15:44, eric.b.hymow...@nasa.gov wrote:

I have two ansible servers, call them ansible-a and ansible-b .
ansible-a is my "primary" most-often-used ansible server for most of my
hosts including ansible-b.  However, there is a segregated network that
ansible-a cannot get to, so ansible-b is the ansible server for those 
hosts

on that network.

I would like to set up a dynamic inventory script so that ansible-a can
refer to hosts managed by the ansible-b server, without manually
duplicating the ansible-b inventory on ansible-a .

I'm hoping somebody has done this already, and has a dynamic inventory
script that will properly

   - query another ansible server
   - specify a group that the remote ansible server knows about
   - return the appropriate hosts in the appropriate format

I tried searching ansible-galaxy, but all I can find are roles.  Maybe 
I'm

not searching correctly.  I have poor google-fu.

Can somebody point me the way?


You could use ansible-b as a ssh proxy/bastion and have all the ansible 
configuration on ansible-a.
Then when ansible-a need to contact host on the segregated network the 
connection would be proxy-ed through a ansible-b.



To make the dynamic inventory you could do this

#!/bin/bash

ssh @ansible-a "cd /path/to/the/ansible/configuration; 
ansible-inventory all --list



Make it executable and put it in you inventory on ansible-b.


--
Kai Stian Olstad

--
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f66478c4b796489b98bebf1344dbf04a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
even using {{ role_path}} does not work, this slowly is getting out of 
hand...

- local_action: command "{{ item }}"
  with_items:
  - "pwd"
  - "{{ role_path }}/files/inventoryctl.py group -U -n LNZ"
  - "{{ role_path }}/files/inventoryctl.py host -U -H {{ 
inventory_hostname }} -g LNZ"
  when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
(itsv_machine_serial.stdout is match "IBM,02781A6CX") or
(itsv_machine_serial.stdout is match "IBM,02781A6DX")


TASK [hostgroups : command] 
***
changed: [AMTEST1 -> localhost] => (item=pwd)
failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/files
/inventoryctl.py group -U -n LNZ) => {"changed": false, "cmd": 
"'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
group -U -n LNZ'", "item": 
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
failed: [AMTEST1 -> localhost] (item=/etc/ansible/aix/roles/hostgroups/files
/inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd": 
"'/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ'", "item": 
"/etc/ansible/aix/roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ", "msg": "[Errno 2] No such file or directory", 
"rc": 2}





On Monday, August 6, 2018 at 3:47:56 PM UTC+2, christia...@itsv.at wrote:
>
> ---
> # tasks file for hostgroups
> - shell: /usr/bin/uname -L | cut -d ' ' -f2
>   register: itsv_lparname
>
> - command: /usr/sbin/lsattr -El sys0 -a systemid -F value
>   register: itsv_machine_serial
>
> - command: pwd
>
> - local_action: command "{{ item }}"
>   with_items:
>   - "pwd"
>   - "inventoryctl.py group -U -n LNZ"
>   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g LNZ"
>   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6DX")
>
>
> output:
>
> root@lpgaixmgmtlx01:/etc/ansible/aix>ansible-playbook -i AMTEST1, testplay
> .yml
>
> PLAY [run test play] 
> **
>
> TASK [hostgroups : shell] 
> *
> changed: [AMTEST1]
>
> TASK [hostgroups : command] 
> ***
> changed: [AMTEST1]
>
> TASK [hostgroups : command] 
> ***
> changed: [AMTEST1]
>
> TASK [hostgroups : command] 
> ***
> changed: [AMTEST1 -> localhost] => (item=pwd)
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => {
> "changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
> "inventoryctl.py 
> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g 
> LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 -g 
> LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno 
> 2] No such file or directory", "rc": 2}
>
> PLAY RECAP 
> 
> AMTEST1: ok=3changed=3unreachable=0failed=
> 1
>
>
>
>
>
> On Monday, August 6, 2018 at 3:36:11 PM UTC+2, Karl Auer wrote:
>>
>> When stuff doesn't work, you have to stop making assumptions.
>>
>> Use the "command" module to run
>> a shell command to tell you the hostname, path and CWD on whatever host 
>> Ansible is running these tasks on.
>>
>> Then you will know what's what and can adjust your playbook.
>>
>> Regards, K.
>>
>>
>>
>> On Mon, Aug 6, 2018 at 11:24 PM,  wrote:
>>
>>>
>>> no idea, there is only one $PATH (even if its not mine, whatever my path 
>>> is) so i assume that ansible uses exactly that path. ansible runs as the 
>>> root user here, so roots path should relevant.
>>>
>>> On Monday, August 6, 2018

Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
No output from pwd, but it didn't fail. Maybe you need to add "-v" to your
Ansible command line?

While you are at it, add commands to run "hostname" and "echo $PATH"

Regards, K.


On Mon, Aug 6, 2018 at 11:47 PM,  wrote:

> ---
> # tasks file for hostgroups
> - shell: /usr/bin/uname -L | cut -d ' ' -f2
>   register: itsv_lparname
>
> - command: /usr/sbin/lsattr -El sys0 -a systemid -F value
>   register: itsv_machine_serial
>
> - command: pwd
>
> - local_action: command "{{ item }}"
>   with_items:
>   - "pwd"
>   - "inventoryctl.py group -U -n LNZ"
>   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g LNZ"
>   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
> (itsv_machine_serial.stdout is match "IBM,02781A6DX")
>
>
> output:
>
> root@lpgaixmgmtlx01:/etc/ansible/aix>ansible-playbook -i AMTEST1, testplay
> .yml
>
> PLAY [run test play] **
> 
> 
> 
>
> TASK [hostgroups : shell] **
> 
> 
> ***
> changed: [AMTEST1]
>
> TASK [hostgroups : command] **
> 
> 
> *
> changed: [AMTEST1]
>
> TASK [hostgroups : command] **
> 
> 
> *
> changed: [AMTEST1]
>
> TASK [hostgroups : command] **
> 
> 
> *
> changed: [AMTEST1 -> localhost] => (item=pwd)
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => {
> "changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
> "inventoryctl.py
> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g
> LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 -g
> LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno
> 2] No such file or directory", "rc": 2}
>
> PLAY RECAP 
> 
> 
> 
> AMTEST1: ok=3changed=3unreachable=0failed=
> 1
>
>
>
>
>
> On Monday, August 6, 2018 at 3:36:11 PM UTC+2, Karl Auer wrote:
>>
>> When stuff doesn't work, you have to stop making assumptions.
>>
>> Use the "command" module to run
>> a shell command to tell you the hostname, path and CWD on whatever host
>> Ansible is running these tasks on.
>>
>> Then you will know what's what and can adjust your playbook.
>>
>> Regards, K.
>>
>>
>>
>> On Mon, Aug 6, 2018 at 11:24 PM,  wrote:
>>
>>>
>>> no idea, there is only one $PATH (even if its not mine, whatever my path
>>> is) so i assume that ansible uses exactly that path. ansible runs as the
>>> root user here, so roots path should relevant.
>>>
>>> On Monday, August 6, 2018 at 2:54:21 PM UTC+2, Karl Auer wrote:

 Not in YOUR path, in the path Ansible is using when it executes the
 script. Use the command module and find out what the path is, what the CWD
 is.

 As to whether it is executing on the remote - what have you got in the
 "hosts" line?

 Regards, K.


 On Mon, Aug 6, 2018 at 10:47 PM,  wrote:

> i put the script in path, same errror...
>
> TASK [hostgroups : command] **
> 
> 
> *
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ)
> => {"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'",
> "item": "inventoryctl.py group -U -n LNZ", "msg": "[Errno 2] No such
> file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H
> AMTEST1 -g LNZ) => {"changed": false, "cmd": "'inventoryctl.py host
> -U -H AMTEST1 -g LNZ'", "item": "inventoryctl.py host -U -H AMTEST1
> -g LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>
> PLAY RECAP **
> *

[ansible-project] Re: Help me to install ansible - end up with "Oops! An error occured while running setup"

2018-08-06 Thread Timothy Vigers
Hi Vicky,

Sorry I only just saw this...

I can't really remember but I think it was the database password I had 
configured.

Regards,

Tim

On Thursday, 10 August 2017 00:22:01 UTC+10, Vicky Korpal wrote:
>
> Hi @Timothy
>
> Which password are you talking about ? I am having the same issue and cant 
> find the reason. Thanks in advance
>
> On Monday, 20 February 2017 10:48:15 UTC-6, Timothy Vigers wrote:
>>
>> Hi Ben,
>>
>> Not sure if you ended up fixing it however I had the same issue.
>>
>> It was because of the password that I had set.
>>
>> Regards,
>>
>> Tim
>>
>> On Friday, 23 December 2016 04:26:25 UTC+11, Ben .T.George wrote:
>>>
>>> HI
>>>
>>> i am very new to ansible and i want to setup a POC env for my company.
>>>
>>> i was following 
>>> http://docs.ansible.com/ansible-tower/latest/html/quickinstall/install_script.html
>>>  and 
>>> while running seup, i am getting "[error] Oops!  An error occured while 
>>> running setup."
>>>
>>> and below is the error on log file
>>>
>>>
>>> ASK [awx_install : Wait for supervisor to stop.] 
>>> **
>>> ^[[0;32mok: [localhost] => {"attempts": 1, "changed": false, "stat": 
>>> {"exists": false}}^[[0m
>>>
>>> TASK [awx_install : Migrate the Tower database schema (may take awhile 
>>> when upgrading).] ***
>>> ^[[0;31mfatal: [localhost]: FAILED! => {"changed": true, "cmd": 
>>> ["tower-manage", "migrate", "--noinput", "--fake-initial"], "delta": 
>>> "0:00:01.327536", "end": "2016-12-21 11:40:18.293455", "failed": true, 
>>> "rc": 1, "start": "2016-12-21 11:40:16.965919", "stderr": "Traceback (most 
>>> recent call last):\n  File \"/usr/bin/tower-manage\", line 9, in \n 
>>>load_entry_point('ansible-tower==3.0.3', 'console_scripts', 
>>> 'tower-manage')()\n  File \"/lib/python2.7/site-packages/awx/__init__.py\", 
>>> line 103, in manage\n  File 
>>> \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\",
>>>  
>>> line 354, in execute_from_command_line\nutility.execute()\n  File 
>>> \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\",
>>>  
>>> line 328, in execute\ndjango.setup()\n  File 
>>> \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/__init__.py\", 
>>> line 18, in setup\napps.populate(settings.INSTALLED_APPS)\n  File 
>>> \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/apps/registry.py\",
>>>  
>>> line 108, in populate\napp_config.import_models(all_models)\n  File 
>>> \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/apps/config.py\",
>>>  
>>> line 198, in import_models\nself.models_module = 
>>> import_module(models_module_name)\n  File 
>>> \"/opt/rh/python27/root/usr/lib64/python2.7/importlib/__init__.py\", line 
>>> 37, in import_module\n__import__(name)\n  File 
>>> \"/lib/python2.7/site-packages/awx/main/models/__init__.py\", line 79, in 
>>> \n  File \"/lib/python2.7/site-packages/awx/main/signals.py\", line 
>>> 23, in \n  File \"/lib/python2.7/site-packages/awx/main/tasks.py\", 
>>> line 50, in \n  File 
>>> \"/lib/python2.7/site-packages/awx/main/queue.py\", line 26, in 
>>> \nValueError: too many values to unpack", "stdout": "", 
>>> "stdout_lines": [], "warnings": []}^[[0m
>>>
>>> RUNNING HANDLER [supervisor : restart supervisor] 
>>> **
>>>
>>> RUNNING HANDLER [httpd : restart httpd] 
>>> 
>>> to retry, use: --limit 
>>> @/root/Desktop/ansible-tower-setup-3.0.3/install.retry
>>>
>>> PLAY RECAP 
>>> *
>>> ^[[0;31mlocalhost^[[0m  : ^[[0;32mok=87  ^[[0m 
>>> ^[[0;33mchanged=35  ^[[0m unreachable=0^[[0;31mfailed=1   ^[[0m
>>>
>>>
>>>
>>> how can i fix this issue.
>>>
>>> Regards,
>>> Ben
>>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f65fce82-70ff-483e-b1f1-d674432b547e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
---
# tasks file for hostgroups
- shell: /usr/bin/uname -L | cut -d ' ' -f2
  register: itsv_lparname

- command: /usr/sbin/lsattr -El sys0 -a systemid -F value
  register: itsv_machine_serial

- command: pwd

- local_action: command "{{ item }}"
  with_items:
  - "pwd"
  - "inventoryctl.py group -U -n LNZ"
  - "inventoryctl.py host -U -H {{ inventory_hostname }} -g LNZ"
  when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
(itsv_machine_serial.stdout is match "IBM,02781A6CX") or
(itsv_machine_serial.stdout is match "IBM,02781A6DX")


output:

root@lpgaixmgmtlx01:/etc/ansible/aix>ansible-playbook -i AMTEST1, testplay.
yml

PLAY [run test play] 
**

TASK [hostgroups : shell] 
*
changed: [AMTEST1]

TASK [hostgroups : command] 
***
changed: [AMTEST1]

TASK [hostgroups : command] 
***
changed: [AMTEST1]

TASK [hostgroups : command] 
***
changed: [AMTEST1 -> localhost] => (item=pwd)
failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => {
"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
"inventoryctl.py 
group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g 
LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 -g 
LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno 
2] No such file or directory", "rc": 2}

PLAY RECAP 

AMTEST1: ok=3changed=3unreachable=0failed=1





On Monday, August 6, 2018 at 3:36:11 PM UTC+2, Karl Auer wrote:
>
> When stuff doesn't work, you have to stop making assumptions.
>
> Use the "command" module to run
> a shell command to tell you the hostname, path and CWD on whatever host 
> Ansible is running these tasks on.
>
> Then you will know what's what and can adjust your playbook.
>
> Regards, K.
>
>
>
> On Mon, Aug 6, 2018 at 11:24 PM, > 
> wrote:
>
>>
>> no idea, there is only one $PATH (even if its not mine, whatever my path 
>> is) so i assume that ansible uses exactly that path. ansible runs as the 
>> root user here, so roots path should relevant.
>>
>> On Monday, August 6, 2018 at 2:54:21 PM UTC+2, Karl Auer wrote:
>>>
>>> Not in YOUR path, in the path Ansible is using when it executes the 
>>> script. Use the command module and find out what the path is, what the CWD 
>>> is.
>>>
>>> As to whether it is executing on the remote - what have you got in the 
>>> "hosts" line?
>>>
>>> Regards, K.
>>>
>>>
>>> On Mon, Aug 6, 2018 at 10:47 PM,  wrote:
>>>
 i put the script in path, same errror...

 TASK [hostgroups : command] 
 ***
 failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) 
 => {"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", 
 "item": "inventoryctl.py group -U -n LNZ", "msg": "[Errno 2] No such 
 file or directory", "rc": 2}
 failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H 
 AMTEST1 -g LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U 
 -H AMTEST1 -g LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g 
 LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}

 PLAY RECAP 
 
 AMTEST1: ok=2changed=2unreachable=0   
  failed=1

 root@lpgaixmgmtlx01:/etc/ansible/aix>which inventoryctl.py
 /usr/bin/inventoryctl.py


 could it be that ansible tries to run the script on the remote node 
 instead of local? this mea

[ansible-project] dynamic inventory from another ansbile?

2018-08-06 Thread eric . b . hymowitz
I have two ansible servers, call them ansible-a and ansible-b .
ansible-a is my "primary" most-often-used ansible server for most of my 
hosts including ansible-b.  However, there is a segregated network that 
ansible-a cannot get to, so ansible-b is the ansible server for those hosts 
on that network.

I would like to set up a dynamic inventory script so that ansible-a can 
refer to hosts managed by the ansible-b server, without manually 
duplicating the ansible-b inventory on ansible-a .

I'm hoping somebody has done this already, and has a dynamic inventory 
script that will properly

   - query another ansible server
   - specify a group that the remote ansible server knows about
   - return the appropriate hosts in the appropriate format
   
I tried searching ansible-galaxy, but all I can find are roles.  Maybe I'm 
not searching correctly.  I have poor google-fu.

Can somebody point me the way?

--EbH

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8eaef133-762c-45e3-b173-94b184402987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
When stuff doesn't work, you have to stop making assumptions.

Use the "command" module to run
a shell command to tell you the hostname, path and CWD on whatever host
Ansible is running these tasks on.

Then you will know what's what and can adjust your playbook.

Regards, K.



On Mon, Aug 6, 2018 at 11:24 PM,  wrote:

>
> no idea, there is only one $PATH (even if its not mine, whatever my path
> is) so i assume that ansible uses exactly that path. ansible runs as the
> root user here, so roots path should relevant.
>
> On Monday, August 6, 2018 at 2:54:21 PM UTC+2, Karl Auer wrote:
>>
>> Not in YOUR path, in the path Ansible is using when it executes the
>> script. Use the command module and find out what the path is, what the CWD
>> is.
>>
>> As to whether it is executing on the remote - what have you got in the
>> "hosts" line?
>>
>> Regards, K.
>>
>>
>> On Mon, Aug 6, 2018 at 10:47 PM,  wrote:
>>
>>> i put the script in path, same errror...
>>>
>>> TASK [hostgroups : command] **
>>> 
>>> 
>>> *
>>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) =>
>>> {"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
>>> "inventoryctl.py
>>> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1
>>> -g LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H
>>> AMTEST1 -g LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ",
>>> "msg": "[Errno 2] No such file or directory", "rc": 2}
>>>
>>> PLAY RECAP 
>>> 
>>> 
>>> 
>>> AMTEST1: ok=2changed=2unreachable=0
>>>  failed=1
>>>
>>> root@lpgaixmgmtlx01:/etc/ansible/aix>which inventoryctl.py
>>> /usr/bin/inventoryctl.py
>>>
>>>
>>> could it be that ansible tries to run the script on the remote node
>>> instead of local? this means it runs local right? ([AMTEST1 -> localhost
>>> ])
>>>
>>>
>>>
>>> On Monday, August 6, 2018 at 12:52:37 PM UTC+2, Karl Auer wrote:

 I have not done this myself, but I think that the script you are
 running has to be in the search path ("$PATH") OR you have to specify an
 absolute path ("/[...]/myscript.py") OR you have to specify a path relative
 to the current working directory - that is, the directory that is the CWD
 when ansible tries to execute the script.

 I think that the CWD is not what you think it is.You could find it out
 by executing the command "pwd".

 Regards, K.


 On Mon, Aug 6, 2018 at 8:17 PM,  wrote:

> hmm...does not work.
>
> TASK [hostgroups : command] **
> 
> 
> *
> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/i
> nventoryctl.py group -U -n LNZ) => {"changed": false, "cmd":
> "'roles/hostgroups/files/inventoryctl.py group -U -n LNZ'", "item":
> "roles/hostgroups/files/inventoryctl.py group -U -n LNZ", "msg": "[Errno
> 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/i
> nventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd":
> "'roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ'",
> "item": "roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g
> LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>
> PLAY RECAP **
> 
> 
> **
> AMTEST1: ok=3changed=2unreachable=0
>  failed=1
>
> root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/
> inventoryctl.py
> roles/hostgroups/files/inventoryctl.py: Python script, ASCII text
> executable
>
>
>
>
> On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:
>>
>> On 03.08.2018 16:29, christia...@itsv.at wrote:
>> > i want to run a python script in a role. currently the script is in
>> the
>> > tasks directory but i also tried the file dir which also is not
>> > working.
>> > where i have to put this script so it can be found at runtime?
>>
>> It's using path to find the executable, is it not in the path you
>> need
>> to use relative path or absolute path.
>>
>>
>> > - loca

Re: [ansible-project] Trouble with ec2_vpc_vgw

2018-08-06 Thread ttwalto
My reasoning on that was that I don't need to set up a whole VPN 
connection. It's already set up. I just need to attach the VPC to the 
gateway.

But maybe you're right. It's hard to tell from the documentation on 
docs.ansible.com.

--
Todd


On Friday, August 3, 2018 at 6:31:16 PM UTC-4, Karl Auer wrote:
>
> I have not tried this myself, but it occurs to me that maybe you should be 
> using ec2_vpc_vpn to modify the VPN's gateway, rather than using 
> ec2_vpc_vgw to modify the gateway's VPN.
>
> That is, don't think of it as attaching a VPN to a gateway, think of it as 
> associating a gateway with a VPN.
>
> BTW, name is a parameter for a gateway, though not for a VPN.
>
> Regards, K.
>
>
> On Sat, Aug 4, 2018 at 2:35 AM, > wrote:
>
>> I am trying to run ec2_vpc_vgw just to attach a vpc to a vgw (virtual 
>> private gateway). The vgw and vpc both already exist. I don't need to 
>> create them. Here's what I run:
>>
>> - name: attach vpc to virtual private gateway
>>   ec2_vpc_vgw:
>> region: "{{ openshift_aws_region }}"
>> vpc_id: "{{ vpcout.vpcs[0].id }}"
>> vpn_gateway_id: "{{ openshift_aws_vgw_id }}"
>>
>> Here is an error that results:
>>
>> fatal: [localhost]: FAILED! => {
>> "changed": false, 
>> "invocation": {
>> "module_args": {
>> "region": "us-east-1", 
>> "state": "present", 
>> "type": "ipsec.1", 
>> "validate_certs": true, 
>> "vpc_id": "vpc-427cb738", 
>> "vpn_gateway_id": "vgw-ff0ffe96", 
>> "wait_timeout": 320
>> }
>> }, 
>> "msg": "state is present but all of the following are missing: name"
>> }
>>
>> The Ansible modules documentation doesn't say that name is required. And 
>> in this scenario name shouldn't matter anyway, I'm giving it the specific 
>> vgw I want to attach to. The documentation examples don't give an example 
>> of just attaching an existing vpc to an existing vgw. It only has examples 
>> for creating a new vgw or deleting one. So it's no help.
>>
>> Anyone know what's going on here? How do I attach an existing vpc to an 
>> existing vgw?
>>
>> --
>> Todd
>>
>> -- 
>> 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 post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d5b93425-0366-46a8-bbc9-c06b698dd5ae%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Karl Auer
>
> Email  : ka...@2pisoftware.com 
> Website: http://2pisoftware.com
>
> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0726-1ceb-4d2d-bb6d-81f57f635f5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel

no idea, there is only one $PATH (even if its not mine, whatever my path 
is) so i assume that ansible uses exactly that path. ansible runs as the 
root user here, so roots path should relevant.

On Monday, August 6, 2018 at 2:54:21 PM UTC+2, Karl Auer wrote:
>
> Not in YOUR path, in the path Ansible is using when it executes the 
> script. Use the command module and find out what the path is, what the CWD 
> is.
>
> As to whether it is executing on the remote - what have you got in the 
> "hosts" line?
>
> Regards, K.
>
>
> On Mon, Aug 6, 2018 at 10:47 PM, > 
> wrote:
>
>> i put the script in path, same errror...
>>
>> TASK [hostgroups : command] 
>> ***
>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => 
>> {"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
>> "inventoryctl.py 
>> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g 
>> LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 
>> -g LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": 
>> "[Errno 
>> 2] No such file or directory", "rc": 2}
>>
>> PLAY RECAP 
>> 
>> AMTEST1: ok=2changed=2unreachable=0failed
>> =1
>>
>> root@lpgaixmgmtlx01:/etc/ansible/aix>which inventoryctl.py
>> /usr/bin/inventoryctl.py
>>
>>
>> could it be that ansible tries to run the script on the remote node 
>> instead of local? this means it runs local right? ([AMTEST1 -> localhost]
>> )
>>
>>
>>
>> On Monday, August 6, 2018 at 12:52:37 PM UTC+2, Karl Auer wrote:
>>>
>>> I have not done this myself, but I think that the script you are running 
>>> has to be in the search path ("$PATH") OR you have to specify an absolute 
>>> path ("/[...]/myscript.py") OR you have to specify a path relative to the 
>>> current working directory - that is, the directory that is the CWD when 
>>> ansible tries to execute the script.
>>>
>>> I think that the CWD is not what you think it is.You could find it out 
>>> by executing the command "pwd".
>>>
>>> Regards, K.
>>>
>>>
>>> On Mon, Aug 6, 2018 at 8:17 PM,  wrote:
>>>
 hmm...does not work.

 TASK [hostgroups : command] 
 ***
 failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/
 inventoryctl.py group -U -n LNZ) => {"changed": false, "cmd": 
 "'roles/hostgroups/files/inventoryctl.py 
 group -U -n LNZ'", "item": "roles/hostgroups/files/inventoryctl.py 
 group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2
 }
 failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/
 inventoryctl.py host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd": 
 "'roles/hostgroups/files/inventoryctl.py 
 host -U -H AMTEST1 -g LNZ'", "item": 
 "roles/hostgroups/files/inventoryctl.py 
 host -U -H AMTEST1 -g LNZ", "msg": "[Errno 2] No such file or 
 directory", "rc": 2}

 PLAY RECAP 
 
 AMTEST1: ok=3changed=2unreachable=0   
  failed=1

 root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/
 inventoryctl.py
 roles/hostgroups/files/inventoryctl.py: Python script, ASCII text 
 executable




 On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:
>
> On 03.08.2018 16:29, christia...@itsv.at wrote: 
> > i want to run a python script in a role. currently the script is in 
> the 
> > tasks directory but i also tried the file dir which also is not 
> > working. 
> > where i have to put this script so it can be found at runtime? 
>
> It's using path to find the executable, is it not in the path you need 
> to use relative path or absolute path. 
>
>
> > - local_action: command "{{ item }}" 
> >   with_items: 
> >   - "inventoryctl.py group -U -n LNZ" 
> >   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g 
> > LNZ" 
> >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6DX") 
>>>

[ansible-project] Remove CA in Bundle CA via Playbook

2018-08-06 Thread Vincent Descargues
That's my problem, it's pretty simple, I think. I wish I could delete a CA 
in a CA Bundle with one command
For example :
My CA bundle :

1° CA
2° CA
3° CA 
4° CA

And I just want to delete the 2nd certificate
Currently

---
- name: Copy crt
  hosts: servertest
  sudo: yes
  become_method: su
  remote_user: root
  tasks:
 - name: Copy adlds.crt
   copy:
 src: /etc/ansible/crt/adlds.crt
 dest: /etc/pki/ca-trust/source/anchors/
 - name: Enable update-ca-trust
   shell: /usr/bin/update-ca-trust enable
 - name: Extract certificates
   shell: update-ca-trust
 - name: Delete old CA
   shell: 


I know how to implement a certificate in CA bundle now I would just like to 
delete one (the old certificate), maybe with rm but it is bundle and so i 
can't.

Thx for answers :)

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1c1aef1e-b6ab-4516-9eac-b5b62aa6d960%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
Not in YOUR path, in the path Ansible is using when it executes the script.
Use the command module and find out what the path is, what the CWD is.

As to whether it is executing on the remote - what have you got in the
"hosts" line?

Regards, K.


On Mon, Aug 6, 2018 at 10:47 PM,  wrote:

> i put the script in path, same errror...
>
> TASK [hostgroups : command] **
> 
> 
> *
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => {
> "changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
> "inventoryctl.py
> group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g
> LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 -g
> LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno
> 2] No such file or directory", "rc": 2}
>
> PLAY RECAP 
> 
> 
> 
> AMTEST1: ok=2changed=2unreachable=0failed=
> 1
>
> root@lpgaixmgmtlx01:/etc/ansible/aix>which inventoryctl.py
> /usr/bin/inventoryctl.py
>
>
> could it be that ansible tries to run the script on the remote node
> instead of local? this means it runs local right? ([AMTEST1 -> localhost])
>
>
>
> On Monday, August 6, 2018 at 12:52:37 PM UTC+2, Karl Auer wrote:
>>
>> I have not done this myself, but I think that the script you are running
>> has to be in the search path ("$PATH") OR you have to specify an absolute
>> path ("/[...]/myscript.py") OR you have to specify a path relative to the
>> current working directory - that is, the directory that is the CWD when
>> ansible tries to execute the script.
>>
>> I think that the CWD is not what you think it is.You could find it out by
>> executing the command "pwd".
>>
>> Regards, K.
>>
>>
>> On Mon, Aug 6, 2018 at 8:17 PM,  wrote:
>>
>>> hmm...does not work.
>>>
>>> TASK [hostgroups : command] **
>>> 
>>> 
>>> *
>>> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl
>>> .py group -U -n LNZ) => {"changed": false, "cmd":
>>> "'roles/hostgroups/files/inventoryctl.py group -U -n LNZ'", "item":
>>> "roles/hostgroups/files/inventoryctl.py group -U -n LNZ", "msg": "[Errno
>>> 2] No such file or directory", "rc": 2}
>>> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl
>>> .py host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd":
>>> "'roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ'",
>>> "item": "roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g
>>> LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>>>
>>> PLAY RECAP 
>>> 
>>> 
>>> 
>>> AMTEST1: ok=3changed=2unreachable=0
>>>  failed=1
>>>
>>> root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/invento
>>> ryctl.py
>>> roles/hostgroups/files/inventoryctl.py: Python script, ASCII text
>>> executable
>>>
>>>
>>>
>>>
>>> On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:

 On 03.08.2018 16:29, christia...@itsv.at wrote:
 > i want to run a python script in a role. currently the script is in
 the
 > tasks directory but i also tried the file dir which also is not
 > working.
 > where i have to put this script so it can be found at runtime?

 It's using path to find the executable, is it not in the path you need
 to use relative path or absolute path.


 > - local_action: command "{{ item }}"
 >   with_items:
 >   - "inventoryctl.py group -U -n LNZ"
 >   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g
 > LNZ"
 >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
 > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
 > (itsv_machine_serial.stdout is match "IBM,02781A6DX")

 If you have roles/hostgroups/files/inventoryctl.py the command would
 be

roles/hostgroups/files/inventoryctl.py

 --
 Kai Stian Olstad

>>> --
>>> 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.

Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
i put the script in path, same errror...

TASK [hostgroups : command] 
***
failed: [AMTEST1 -> localhost] (item=inventoryctl.py group -U -n LNZ) => {
"changed": false, "cmd": "'inventoryctl.py group -U -n LNZ'", "item": 
"inventoryctl.py 
group -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
failed: [AMTEST1 -> localhost] (item=inventoryctl.py host -U -H AMTEST1 -g 
LNZ) => {"changed": false, "cmd": "'inventoryctl.py host -U -H AMTEST1 -g 
LNZ'", "item": "inventoryctl.py host -U -H AMTEST1 -g LNZ", "msg": "[Errno 
2] No such file or directory", "rc": 2}

PLAY RECAP 

AMTEST1: ok=2changed=2unreachable=0failed=1

root@lpgaixmgmtlx01:/etc/ansible/aix>which inventoryctl.py
/usr/bin/inventoryctl.py


could it be that ansible tries to run the script on the remote node instead 
of local? this means it runs local right? ([AMTEST1 -> localhost])



On Monday, August 6, 2018 at 12:52:37 PM UTC+2, Karl Auer wrote:
>
> I have not done this myself, but I think that the script you are running 
> has to be in the search path ("$PATH") OR you have to specify an absolute 
> path ("/[...]/myscript.py") OR you have to specify a path relative to the 
> current working directory - that is, the directory that is the CWD when 
> ansible tries to execute the script.
>
> I think that the CWD is not what you think it is.You could find it out by 
> executing the command "pwd".
>
> Regards, K.
>
>
> On Mon, Aug 6, 2018 at 8:17 PM, > wrote:
>
>> hmm...does not work.
>>
>> TASK [hostgroups : command] 
>> ***
>> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py 
>> group -U -n LNZ) => {"changed": false, "cmd": 
>> "'roles/hostgroups/files/inventoryctl.py 
>> group -U -n LNZ'", "item": "roles/hostgroups/files/inventoryctl.py group 
>> -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
>> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py 
>> host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd": 
>> "'roles/hostgroups/files/inventoryctl.py 
>> host -U -H AMTEST1 -g LNZ'", "item": "roles/hostgroups/files/inventoryctl.py 
>> host -U -H AMTEST1 -g LNZ", "msg": "[Errno 2] No such file or directory", 
>> "rc": 2}
>>
>> PLAY RECAP 
>> 
>> AMTEST1: ok=3changed=2unreachable=0failed
>> =1
>>
>> root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/
>> inventoryctl.py
>> roles/hostgroups/files/inventoryctl.py: Python script, ASCII text 
>> executable
>>
>>
>>
>>
>> On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:
>>>
>>> On 03.08.2018 16:29, christia...@itsv.at wrote: 
>>> > i want to run a python script in a role. currently the script is in 
>>> the 
>>> > tasks directory but i also tried the file dir which also is not 
>>> > working. 
>>> > where i have to put this script so it can be found at runtime? 
>>>
>>> It's using path to find the executable, is it not in the path you need 
>>> to use relative path or absolute path. 
>>>
>>>
>>> > - local_action: command "{{ item }}" 
>>> >   with_items: 
>>> >   - "inventoryctl.py group -U -n LNZ" 
>>> >   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g 
>>> > LNZ" 
>>> >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or 
>>> > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or 
>>> > (itsv_machine_serial.stdout is match "IBM,02781A6DX") 
>>>
>>> If you have roles/hostgroups/files/inventoryctl.py the command would be 
>>>
>>>roles/hostgroups/files/inventoryctl.py 
>>>
>>> -- 
>>> Kai Stian Olstad 
>>>
>> -- 
>> 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 post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/aa1c1828-881f-49a3-bab4-6b3add73bb11%40googlegroups.com
>>  
>> 
>> .
>> For more opt

Re: [ansible-project] running ptython script in role

2018-08-06 Thread Karl Auer
I have not done this myself, but I think that the script you are running
has to be in the search path ("$PATH") OR you have to specify an absolute
path ("/[...]/myscript.py") OR you have to specify a path relative to the
current working directory - that is, the directory that is the CWD when
ansible tries to execute the script.

I think that the CWD is not what you think it is.You could find it out by
executing the command "pwd".

Regards, K.


On Mon, Aug 6, 2018 at 8:17 PM,  wrote:

> hmm...does not work.
>
> TASK [hostgroups : command] **
> 
> 
> *
> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py
> group -U -n LNZ) => {"changed": false, "cmd": 
> "'roles/hostgroups/files/inventoryctl.py
> group -U -n LNZ'", "item": "roles/hostgroups/files/inventoryctl.py group
> -U -n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
> failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py
> host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd":
> "'roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ'",
> "item": "roles/hostgroups/files/inventoryctl.py host -U -H AMTEST1 -g LNZ"
> , "msg": "[Errno 2] No such file or directory", "rc": 2}
>
> PLAY RECAP 
> 
> 
> 
> AMTEST1: ok=3changed=2unreachable=0failed=
> 1
>
> root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/invento
> ryctl.py
> roles/hostgroups/files/inventoryctl.py: Python script, ASCII text
> executable
>
>
>
>
> On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:
>>
>> On 03.08.2018 16:29, christia...@itsv.at wrote:
>> > i want to run a python script in a role. currently the script is in the
>> > tasks directory but i also tried the file dir which also is not
>> > working.
>> > where i have to put this script so it can be found at runtime?
>>
>> It's using path to find the executable, is it not in the path you need
>> to use relative path or absolute path.
>>
>>
>> > - local_action: command "{{ item }}"
>> >   with_items:
>> >   - "inventoryctl.py group -U -n LNZ"
>> >   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g
>> > LNZ"
>> >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
>> > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or
>> > (itsv_machine_serial.stdout is match "IBM,02781A6DX")
>>
>> If you have roles/hostgroups/files/inventoryctl.py the command would be
>>
>>roles/hostgroups/files/inventoryctl.py
>>
>> --
>> Kai Stian Olstad
>>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/aa1c1828-881f-49a3-bab4-6b3add73bb11%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08RzRxNr__Ocsg6j8983KXpe--7euoPS1uFkf7%2BWJ%3DB6LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_shell task failing with ansible error: Get-AnsibleParam: Missing required argument: _raw_params

2018-08-06 Thread 'J Hawkesworth' via Ansible Project
Have a look at the examples in the module 
documentation 
https://docs.ansible.com/ansible/latest/modules/win_shell_module.html#examples 
and you'll see the format is a little different.  
This ought to run your script.  

You might want to use the `script` module which can deliver your script to 
the remote machine and run it in the same step (script also works for 
windows targets).

- name: DPS Server Installation

  win_shell: C:\temp\nd6.1.1.20.7\Scripts\nd.Install\Install-DPS.ps1

Hope this helps,

Jon

On Saturday, August 4, 2018 at 6:43:38 AM UTC+1, Ali Khawaja wrote:
>
> Ansible version: 2.6.1 (and I tried with 2.7.0 development branch as well)
>
>  
>
> I have a simple win_shell task though which I am trying to execute 
> powershell script which is sitting on the remote system. I have verified 
> the path and the existence of script.
>
>  
>
> - name: DPS Server Installation
>
>   win_shell: 
>
>   args: C:\temp\nd6.1.1.20.7\Scripts\nd.Install\Install-DPS.ps1
>
>  
>
> Ansible keeps failing with the following error message:
>
>  
>
> TASK [DPS Server Installation] 
> ***
>
> fatal: [i-01f6259784352dff3]: FAILED! => {"changed": false, "msg": 
> "Get-AnsibleParam: Missing required argument: _raw_params"}
>
> to retry, use: --limit @/mnt/c/GitHub/alikha-spnd/autosp.retry
>
>  
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/905d9018-87e9-4a3d-acee-9b9d6f6e3078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] running ptython script in role

2018-08-06 Thread christian . tremel
hmm...does not work.

TASK [hostgroups : command] 
***
failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py 
group -U -n LNZ) => {"changed": false, "cmd": 
"'roles/hostgroups/files/inventoryctl.py 
group -U -n LNZ'", "item": "roles/hostgroups/files/inventoryctl.py group -U 
-n LNZ", "msg": "[Errno 2] No such file or directory", "rc": 2}
failed: [AMTEST1 -> localhost] (item=roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ) => {"changed": false, "cmd": 
"'roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ'", "item": "roles/hostgroups/files/inventoryctl.py 
host -U -H AMTEST1 -g LNZ", "msg": "[Errno 2] No such file or directory", 
"rc": 2}

PLAY RECAP 

AMTEST1: ok=3changed=2unreachable=0failed=1

root@lpgaixmgmtlx01:/etc/ansible/aix>file roles/hostgroups/files/
inventoryctl.py
roles/hostgroups/files/inventoryctl.py: Python script, ASCII text executable




On Friday, August 3, 2018 at 7:11:51 PM UTC+2, Kai Stian Olstad wrote:
>
> On 03.08.2018 16:29, christia...@itsv.at  wrote: 
> > i want to run a python script in a role. currently the script is in the 
> > tasks directory but i also tried the file dir which also is not 
> > working. 
> > where i have to put this script so it can be found at runtime? 
>
> It's using path to find the executable, is it not in the path you need 
> to use relative path or absolute path. 
>
>
> > - local_action: command "{{ item }}" 
> >   with_items: 
> >   - "inventoryctl.py group -U -n LNZ" 
> >   - "inventoryctl.py host -U -H {{ inventory_hostname }} -g 
> > LNZ" 
> >   when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6CX") or 
> > (itsv_machine_serial.stdout is match "IBM,02781A6DX") 
>
> If you have roles/hostgroups/files/inventoryctl.py the command would be 
>
>roles/hostgroups/files/inventoryctl.py 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aa1c1828-881f-49a3-bab4-6b3add73bb11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Tower installation question

2018-08-06 Thread elavarde
You just need to mount your disk in the right place, i.e. /var/lib/pgsql if 
I remember correctly. It's then transparent to the installer.

On Friday, 3 August 2018 17:03:27 UTC+2, taylo...@gmail.com wrote:
>
> I have a RJEL 7 server that I'm getting ready to install Tower on, but I 
> have created a second disk that I would like the database installed on. Is 
> this possible? 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0347f4d8-85f5-4846-bad3-363dbe7a8a05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] how to get a complete git log using ansible to do git pull

2018-08-06 Thread Eric Chang
I wrote a easy playbook to been called when devops do a git push with 
webhook.

if Devs do a git push , webhook will notify my ansible server to run a 
script which run anisble-playbook myplaybook -i inventory_name -vvv | tee 
-a /tmp/myplaybook_result.log

but the log file only contain the anisble result , not the git pull 
messages .

and I see no log in git module of ansible.

so , is there anyway to get the git pull messages from remote machine to 
ansible server ? or just save the log  somewhere in remote machine ?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4c95cf1d-25ff-4fce-8336-25387bf538d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.