Re: [ansible-project] Re: how to filter with variables instead of literals in ec2_instance_facts?

2019-09-19 Thread vivek dalal
Thank you so much! The below syntax worked for me as well.

filters: "{{ { 'tag:' ~ tag_name: tag_value } }}"

I had a follow up question related to this. How can I add multiple filters 
with one filter being "{{ { 'tag:' ~ tag_name: tag_value } }}"?

I am trying to add it like we do in all other cases(shown below) but it 
gives an error.

filters:
  instance-state-name: ["running"]
"{{ { 'tag:' ~ tag_name: tag_value } }}"

However, I get a syntax error.

Can you please suggest what am I doing wrong?

Thanks in advance!!


On Saturday, 5 May 2018 20:10:05 UTC-4, flowerysong wrote:
>
> On Saturday, May 5, 2018 at 7:54:27 PM UTC-4, Karl Auer wrote:
>>
>>
>> Did you actually try that?
>>
>> When I use that, I get the same error as before: An error occurred 
>> (InvalidParameterValue) when calling the DescribeInstances operation: The 
>> filter 'GroupName' is invalid
>>
>> ("GroupName" is the value in my variable tag_name)
>>
>
> Yes, it works. You have to construct a valid filter, and GroupName isn't a 
> valid filter.
>  
> - hosts: localhost
>   become: false
>   tasks:
> - ec2_instance_facts:
> filters: "{{ { tag_name: tag_value } }}"
>   vars:
> tag_name: "tag:Name"
> tag_value: "*"
> - ec2_instance_facts:
> filters: "{{ { 'tag:' ~ tag_name: tag_value } }}"
>   vars:
> tag_name: Name
> tag_value: "*"
>
>
> PLAY [localhost] 
> ***
>
> TASK [Gathering Facts] 
> *
> ok: [localhost]
>
> TASK [ec2_instance_facts] 
> **
> ok: [localhost]
>
> TASK [ec2_instance_facts] 
> **
> ok: [localhost]
>
> PLAY RECAP 
> *
> localhost  : ok=3changed=0unreachable=0failed=0
>
>

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


Re: [ansible-project] Do not wish to use python for Ansible's file module.

2019-09-19 Thread Brian Coca
You can create your own custom module in whatever language that your
targets can support, but the modules Ansible ships with require
python.

-- 
--
Brian Coca

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


[ansible-project] calling a role and passing it a different host

2019-09-19 Thread Spiro Mitsialis
I have playbook that is running for a network switch.  From within this 
playbook, I want to call a role which will run a IOS Ansible module but the 
host should be a different device (host).  The different device is its 
upstream neighbor which the first playbook gets doing a URI call to a 
database.  I dont have the information before the URI call.
Both devices are listed in my hosts inventory file.
I have tried listing the new host in the role/vars/main.yml file but it 
still sees the first network switch.
hosts: xxx

I have also tried specifying hosts when calling the role:
  - name: call manage trunk vlans
include_role: 
  name: manage_trunk_vlans
vars:
  hosts: burnside-lab-srp.gw.mcgill.ca

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


[ansible-project] Re: Get file(s) from a remote host to local host

2019-09-19 Thread R-JRI
Thanks, Brian

That works.

On Wednesday, September 18, 2019 at 2:31:17 PM UTC-4, R-JRI wrote:
>
> Hi,
>
> I created a simple yml file to get file or files from a remote host to 
> local host:
> $ cat fetch.yml
> ---
> - hosts: serverA
>
>   tasks:
>   - name: find the files
> find:
>   paths: /usr/local/apps/log
>   patterns: AppsAdmin.*.ALLAPPS.20190828*
>   use_regex: True
> register: Apps_files
>
>   - debug:
>   var: Apps_files.files.path
>
>   - name:
> fetch:
>   src: "{{ item }}"
>   dest: /APPADMIN/ansible/nonprod/DR_test/
> with_items: "{{ Apps_files.files.path }}"
>
> The variable 'Apps_files.files.path' is getting from the output of debug.
>
> Here is the output when ran it.
>
> [appadmin@serverB][/APPADMIN/ansible/nonprod/DR_test]$ ansible-playbook  
> fetch.yml
>
> PLAY [serverA] 
> 
>
> TASK [Gathering Facts] 
> **
> ok: [serverA]
>
> TASK [find the files] 
> ***
> ok: [serverA]
>
> TASK [debug] 
> 
> ok: [serverA] => {
> "Apps_files.files.path": "VARIABLE IS NOT DEFINED!"
> }
>
> TASK [fetch] 
> 
> fatal: [serverA]: FAILED! => {"msg": "'list object' has no attribute 
> 'path'"}
>
> PLAY RECAP 
> **
> serverA : ok=3changed=0unreachable=0failed=1
> skipped=0rescued=0ignored=0
>
>
> When debug model only has Apps_files as variable:
> -debug:
>  var: Apps_files
>
> The output of debug is:
> TASK [debug] 
> 
> ok: [serverA] => {
> "Apps_files": {
> "changed": false,
> "examined": 36,
> "failed": false,
> "files": [
> {
> "atime": 1567021803.0147924,
> "ctime": 1567021803.0087924,
> "dev": 64770,
> "gid": 0,
> "gr_name": "root",
> "inode": 134304,
> "isblk": false,
> "ischr": false,
> "isdir": false,
> "isfifo": false,
> "isgid": false,
> "islnk": false,
> "isreg": true,
> "issock": false,
> "isuid": false,
> "mode": "0644",
> "mtime": 1567021803.0047922,
> "nlink": 1,
> "path": 
> "/usr/local/apps/log/AppsAdmin.stop.ALLAPPS.201908281548.21882.log", <-- 
> file wanted to get from serverA
> "pw_name": "root",
> "rgrp": true,
> "roth": true,
> "rusr": true,
> "size": 10253,
> "uid": 0,
> "wgrp": false,
> "woth": false,
> "wusr": true,
> "xgrp": false,
> "xoth": false,
> "xusr": false
> },
> {
> "atime": 1568752920.7074213,
> "ctime": 1567023296.6011353,
> "dev": 64770,
> "gid": 0,
> "gr_name": "root",
> "inode": 134315,
> "isblk": false,
> "ischr": false,
> "isdir": false,
> "isfifo": false,
> "isgid": false,
> "islnk": false,
> "isreg": true,
> "issock": false,
> "isuid": false,
> "mode": "0644",
> "mtime": 1567023296.5971353,
> "nlink": 1,
> "path": 
> 

[ansible-project] Image Snapshot Module for Openstack

2019-09-19 Thread Rakesh Parida
Hi ,
The ansible has a module to take volume snapshot for Openstack:
- name: create snapshot
  hosts: all
  tasks:
  - name: create snapshot
os_volume_snapshot:
  state: present
  cloud: test
  availability_zone: nova
  display_name: test_snapshot
  volume: test_volume

  My requirement is to take only Image snapshot as my Openstack is 
associated with External NFS, so i need to take only image snapshot.
Is there any module to take image snapsnot rather than Volume snapshot.
Any help will be appreciated.

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


[ansible-project] Ansible - pip not found

2019-09-19 Thread Keith Mills
COMPONENT NAME

pip


ANSIBLE VERSION

ansible 2.8.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u
'/home/jamekeit/.ansible/plugins/modules', u
'/usr/share/ansible/plugins/modules']

CONFIGURATION

N/A


OS / ENVIRONMENT

OS running from Red Hat Enterprise Linux Server 7.5

OS managing: SLES 15-SP1


SUMMARY

I am trying to install virtualenv tool to create isolated Python 
environments, but it is unable to find the pip executable through Ansible. 
I have run pip install virtuaenvmanually on SLES 15-SP1 and it works 
successfully.


Tasks:


- name: install pip
  easy_install:
name: pip
state: latest
- name: install additional pip modules
  pip:
name: virtualenv
executable: pip-3.6
  environment:
http_proxy: "http://proxy.houston.hpecorp.net:8080;
https_proxy: "http://proxy.houston.hpecorp.net:8080;


Error:


TASK [buildservers : install additional pip modules] 




fatal: [abls15ex6406]: FAILED! => {"changed": false, "msg": "Unable to find 
any of pip-2.7 to use.  pip needs to be installed."}


PIP is already installed on the host.


Help will be appreciated!

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


Re: [ansible-project] Firewalld fails to start on SLES 15 SP1

2019-09-19 Thread Keith Mills
My bad! Posted in wrong forum.

On Monday, September 16, 2019 at 1:35:27 PM UTC-5, Stefan Hornburg (Racke) 
wrote:
>
> On 9/16/19 8:28 PM, Keith Mills wrote: 
> > Dear Readers, 
> > 
> > Firewalld fails to start for SLES 15 SP1.  
> > 
> > | 
>
> That's a pity, but how is this related to Ansible? 
>
> Regards 
>  Racke 
>
> > # systemctl status firewalld 
> > ●firewalld.service -firewalld -dynamicfirewall daemon 
> >Loaded:loaded 
> (/usr/lib/systemd/system/firewalld.service;enabled;vendor preset:disabled) 
> >Active:failed (Result:exit-code)since 
> Mon2019-09-1617:51:06UTC;25minago 
> >  Docs:man:firewalld(1) 
> >  MainPID:1061(code=exited,status=1/FAILURE) 
> > 
> > 
> > Sep1617:51:05abls15ex6401 systemd[1]:Startingfirewalld -dynamicfirewall 
> daemon... 
> > Sep1617:51:06abls15ex6401 systemd[1]:firewalld.service:Mainprocess 
> exited,code=exited,status=1/FAIL> 
> > Sep1617:51:06abls15ex6401 systemd[1]:Failedto start firewalld 
> -dynamicfirewall daemon. 
> > Sep1617:51:06abls15ex6401 systemd[1]:firewalld.service:Unitentered 
> failed state. 
> > Sep1617:51:06abls15ex6401 systemd[1]:firewalld.service:Failedwithresult 
> 'exit-code'. 
> > | 
> > 
> > 
> > More information; output firewall-cmd command gives: 
> > 
> >   
> > | 
> > # firewall-cmd --help 
> > Traceback(most recent call last): 
> >   File"/usr/bin/firewall-cmd",line 31,in 
> > fromfirewall.client 
> importFirewallClient,FirewallClientIPSetSettings,\ 
> >   File"/usr/lib/python3.6/site-packages/firewall/client.py",line 
> 29,in 
> > importslip.dbus 
> >   File"/usr/lib/python3.6/site-packages/slip/dbus/__init__.py",line 
> 8,in 
> > from.importservice 
> >   File"/usr/lib/python3.6/site-packages/slip/dbus/service.py",line 
> 34,in 
> > from.importpolkit 
> >   File"/usr/lib/python3.6/site-packages/slip/dbus/polkit.py",line 
> 31,in 
> > fromdecorator importdecorator 
> > ModuleNotFoundError:Nomodulenamed 'decorator' 
> > 
> > | 
> > 
> > 
> > package version inconsistencies: 
> > 
> > | 
> > # zypper ve --dry-run 
> > Loadingrepository data... 
> > Readinginstalled packages... 
> > 
> > 
> > Problem:nothing provides ilorest_chif >=2.3.0needed 
> bypython-ilorest-library-3.0.0-1.noarch 
> >  Solution1:deinstallation of python-ilorest-library-3.0.0-1.noarch 
> >  Solution2:breakpython-ilorest-library-3.0.0-1.noarchbyignoring some of 
> its dependencies 
> > 
> > 
> > Choosefromabove solutions bynumber orcancel [1/2/c](c): 
> > 
> > 
> > | 
> > 
> >   
> > | 
> > systemctl -t service 
> >   UNIT LOAD   ACTIVE SUB DESCRIPTION 
> >   apache2.service  loaded active running 
> TheApacheWebserver 
> >   apparmor.service loaded active exited 
>  LoadAppArmorprofiles 
> >   autofs.service   loaded active running 
> Automountsfilesystems on demand 
> >   chronyd.service  loaded active running NTP 
> client/server 
> >   cron.service loaded active running 
> CommandScheduler 
> >   dbus.service loaded active running 
> D-BusSystemMessageBus 
> >   detect-part-label-duplicates.service loaded active exited  Detectifthe 
> system suffers frombsc#1089761 
> >   dracut-shutdown.service  loaded active exited 
>  Restore/run/initramfs on shutdown 
> > ●firewalld.serviceloaded failed failed  firewalld 
> -dynamicfirewall daemon 
> >   getty@tty1.service   loaded active running Gettyon 
> tty1 
> >   kbdsettings.service  loaded active exited 
>  Applysettings from/etc/sysconfig/keyboard 
> >   kdump-early.service  loaded active exited  Loadkdump 
> kernel early on startup 
> >   kdump.serviceloaded active exited  Loadkdump 
> kernel andinitrd 
> >   kmod-static-nodes.serviceloaded active exited  Createlist 
> of required staticdevice nodes fo> 
> >   mtxserver.serviceloaded active running 
> MatrixBuildAgent 
> >   sshd.service loaded active running 
> OpenSSHDaemon 
> >   systemd-fsck-root.serviceloaded active exited 
>  FileSystemCheckon RootDevice 
> >   systemd-journal-flush.serviceloaded active exited 
>  FlushJournalto PersistentStorage 
> >   systemd-journald.service loaded active running 
> JournalService 
> >   systemd-logind.service   loaded active running 
> LoginService 
> >   systemd-modules-load.service loaded active exited 
>  LoadKernelModules 
> >   systemd-random-seed.service  loaded active exited 
>  Load/SaveRandomSeed 
> >   systemd-remount-fs.service   loaded active exited 
>  RemountRootandKernelFileSystems 
> >   systemd-sysctl.service   loaded active exited 
>  ApplyKernelVariables 
> >   systemd-tmpfiles-setup-dev.service   loaded active exited 
>  CreateStaticDeviceNodesin/dev 
> >   

Re: [ansible-project] Re: How can I run the commnads in Linux vm after creation with vmware_guest

2019-09-19 Thread phani akkina
Hi Aravind,

This will execute the commands on the vm whenever I run the playbook. But I
want to run the commands when vm is created only.

Thanks,
Phani Akkina

On Thu, Sep 19, 2019 at 11:39 AM Aravind Balaji 
wrote:

> Hi Phani Akkina
>
> Here is the example:
>
> - name: Create a virtual machine on given ESXi hostname
>   vmware_guest:
> hostname: "{{ vcenter_hostname }}"
> username: "{{ vcenter_username }}"
> password: "{{ vcenter_password }}"
> validate_certs: no
> folder: /DC1/vm/
> name: test_vm_0001
> state: poweredon
> guest_id: centos64Guest
> # This is hostname of particular ESXi server on which user wants VM to
> be deployed
> esxi_hostname: "{{ esxi_hostname }}"
> disk:
> - size_gb: 10
>   type: thin
>   datastore: datastore1
> hardware:
>   memory_mb: 512
>   num_cpus: 4
>   scsi: paravirtual
> networks:
> - name: VM Network
>   mac: aa:bb:dd:aa:00:14
>   ip: 10.10.10.100
>   netmask: 255.255.255.0
>   device_type: vmxnet3
> wait_for_ip_address: yes
>   delegate_to: localhost
>   register: deploy_vm
>
> - name: Change hostname of guest machine
>   vmware_vm_shell:
> hostname: "{{ vcenter_hostname }}"
> username: "{{ vcenter_username }}"
> password: "{{ vcenter_password }}"
> validate_certs: no
> datacenter: "DC1"
> folder: "/DC1/vm"
> vm_id: "{{ vm_name }}"
> vm_username: testUser
> vm_password: SuperSecretPassword
> vm_shell: "/usr/bin/hostnamectl"
> vm_shell_args: "set-hostname new_hostname > /tmp/$$.txt 2>&1"
>   delegate_to: localhost
>
>
> **
> *Thanks & Regards*,
> Aravind Balaji S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/48c69d43-5436-41f0-9578-baa452e6ff3e%40googlegroups.com
> 
> .
>

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


[ansible-project] Ansible for academic distributed experiment

2019-09-19 Thread Matthieu Simonin
Dear All,

I'd like to share what we are doing using Ansible in an academic context
and maybe bootstrap some discussions about our specific implementation and
needs.

---
TLDR;
In our context, distributed system experimenters aren't expert in system
provisionning and with Ansible we are able to give them nice abstractions
with a good degree of expressivity and safety (e.g idempotency). In this
direction, we built EnOSlib https://discovery.gitlabpages.inria.fr/enoslib/
to provide a smooth integration of Ansible with Python. 

Some initial questions/discussions:
- We use "in-memory" inventory, but we deem our implementation fragile
  Is their a canonical way to populate an Inventory datastructure from 
scratch ?
  (see our implementation[1])

- In some specific use case we are pushing our deployments to the scale of
  thousands of machines and we are seeing the Ansible SSH transport suffer.
  What would be a good way to scale ? (We already identified few things [5])
---



Some details on the Ansible integration which intensively uses the Python
API so that experimenter can stick with their python code as much as
possible.

- We target different infrastructure but don't rely on dynamic inventory.
  We rather provide a way to generate an inventory from python. Once the
  infrastructure resources are ready the inventory is either:
  + dumped on the file system (and reloaded when needed)
  + or generated on the fly when needed (in memory)[1]. In my opinion the
corresponding code is fragile as it subclasses the Inventory 
datastructure and populate it manually.

- We provide a `run_ansible`[2] function to run any Ansible playbook.

- We provide a Python context manager[3] to allow programmer to call 
Ansible Modules
  directly from Python. This is considered as a very convenient way to 
script
  remote actions on nodes from Python.

- Built on this two, we provide built-in services to deploy common tool 
used 
  when experimenting with distributed systems (e.g [4])

[1] 
https://gitlab.inria.fr/discovery/enoslib/blob/master/enoslib/enos_inventory.py
[2] 
https://discovery.gitlabpages.inria.fr/enoslib/apidoc/api.html#enoslib.api.run_ansible
[3] 
https://discovery.gitlabpages.inria.fr/enoslib/apidoc/api.html#enoslib.api.play_on
[4] 
https://discovery.gitlabpages.inria.fr/enoslib/apidoc/service.html#monitoring
[5] https://discovery.gitlabpages.inria.fr/enoslib/performance_tuning.html

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


Re: [ansible-project] Re: How can I run the commnads in Linux vm after creation with vmware_guest

2019-09-19 Thread Aravind Balaji
Hi Phani Akkina

Here is the example:

- name: Create a virtual machine on given ESXi hostname
  vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
folder: /DC1/vm/
name: test_vm_0001
state: poweredon
guest_id: centos64Guest
# This is hostname of particular ESXi server on which user wants VM to 
be deployed
esxi_hostname: "{{ esxi_hostname }}"
disk:
- size_gb: 10
  type: thin
  datastore: datastore1
hardware:
  memory_mb: 512
  num_cpus: 4
  scsi: paravirtual
networks:
- name: VM Network
  mac: aa:bb:dd:aa:00:14
  ip: 10.10.10.100
  netmask: 255.255.255.0
  device_type: vmxnet3
wait_for_ip_address: yes
  delegate_to: localhost
  register: deploy_vm

- name: Change hostname of guest machine
  vmware_vm_shell:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "DC1"
folder: "/DC1/vm"
vm_id: "{{ vm_name }}"
vm_username: testUser
vm_password: SuperSecretPassword
vm_shell: "/usr/bin/hostnamectl"
vm_shell_args: "set-hostname new_hostname > /tmp/$$.txt 2>&1"
  delegate_to: localhost


**
*Thanks & Regards*,
Aravind Balaji S

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


Re: [ansible-project] Re: How can I run the commnads in Linux vm after creation with vmware_guest

2019-09-19 Thread phani akkina
Hi Arvind,

Thanks for your reply.

I need to run the commands in Linux after the creation of the vm by
vmware_guest. And these commands also need to run only once. Is that
possible with vmware_vm_shell? If yes do you have any example?

Thanks,
Phani Akkina

On Wed, Sep 18, 2019 at 3:03 PM Aravind Balaji 
wrote:

> Hi phani akkina,
>
> With the help of vmware_vm_shell module(
> https://docs.ansible.com/ansible/latest/modules/vmware_vm_shell_module.html)
> you can execute command inside linux vm.
>
> *Thanks & Regards*,
> Aravind Balaji S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/aeb18c87-6c85-4ee6-b2ec-76ac01c6f99f%40googlegroups.com
> 
> .
>

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


Re: [ansible-project] Do not wish to use python for Ansible's file module.

2019-09-19 Thread Vladimir Botka
On Wed, 18 Sep 2019 23:59:29 -0700 (PDT)
Mohtashim S  wrote:

> I do not have python on the target servers. 
> Is there a way to get ansible do this task without the need of python ?

No. It is not.

Cheers,

-vlado

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


pgpzsoS9sX7cR.pgp
Description: OpenPGP digital signature


[ansible-project] How to Avoid Python dependency on Target servers for Ansible file module

2019-09-19 Thread Mohtashim S
I have the below file module that helps copy files or create directory on 
the target.

   - file:
   path: "{{ vars[inventory_hostname] }}/{{ Relative_Path }}/backup"
   state: directory
   recurse: yes
   mode: "u=rwx,g=rw,o=r"


Unfortunately this has python dependency on the target as seen in the error 
below:

TASK [file] 
> 
> [WARNING]: No python interpreters found for host 10.7.23.92 (tried
> ['/usr/bin/python', 'python3.7', 'python3.6', 'python3.5', 'python2.7',
> 'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])
> fatal: [10.7.23.92]: FAILED! => {"ansible_facts": 
> {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, 
> "module_stderr": "Shared connection to 10.7.23.92 closed.\r\n", 
> "module_stdout": "/bin/sh: /usr/bin/python: not found.\r\n", "msg": "MODULE 
> FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


I do not have python on the target servers. 


Ideally i would think that a simple ssh or other tools are capable of doing 
this without the need for python. 


Is there a way to get ansible do this task without the need of python ?

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


[ansible-project] How-to Avoid Python dependency on target servers

2019-09-19 Thread Mohtashim S

I have the below file module that helps copy files or create directory on 
the target.

   - file:
   path: "{{ vars[inventory_hostname] }}/{{ Relative_Path }}/backup"
   state: directory
   recurse: yes
   mode: "u=rwx,g=rw,o=r"


Unfortunately this has python dependency on the target as seen in the error 
below:

TASK [file] 
> 
> [WARNING]: No python interpreters found for host 10.9.2.192 (tried
> ['/usr/bin/python', 'python3.7', 'python3.6', 'python3.5', 'python2.7',
> 'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])
> fatal: [10.7.23.92]: FAILED! => {"ansible_facts": 
> {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, 
> "module_stderr": "Shared connection to 10.7.23.92 closed.\r\n", 
> "module_stdout": "/bin/sh: /usr/bin/python: not found.\r\n", "msg": "MODULE 
> FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


I do not have python on the target servers. 


Ideally i would think that a simple ssh or other tools are capable of doing 
this without the need for python. 


Is there a way to get ansible do this task without the need of python ?

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


[ansible-project] Do not wish to use python for Ansible's file module.

2019-09-19 Thread Mohtashim S
I have the below file module that helps copy files or create directory on 
the target.

   - file:
   path: "{{ vars[inventory_hostname] }}/{{ Relative_Path }}/backup"
   state: directory
   recurse: yes
   mode: "u=rwx,g=rw,o=r"


Unfortunately this has python dependency on the target as seen in the error 
below:

TASK [file] 
> 
> [WARNING]: No python interpreters found for host 10.9.2.192 (tried
> ['/usr/bin/python', 'python3.7', 'python3.6', 'python3.5', 'python2.7',
> 'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])
> fatal: [10.9.2.192]: FAILED! => {"ansible_facts": 
> {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, 
> "module_stderr": "Shared connection to 10.9.2.192 closed.\r\n", 
> "module_stdout": "/bin/sh: /usr/bin/python: not found.\r\n", "msg": "MODULE 
> FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


I do not have python on the target servers. 


Ideally i would think that a simple ssh or other tools are capable of doing 
this without the need for python. 


Is there a way to get ansible do this task without the need of python ?

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