[ansible-project] Run custom code before first task in playbook

2019-04-15 Thread Pavel Martynov
Hi! I use json facts caching and sometimes this files expires (last modified time > than configured fact_caching_timeout). This is a rare problem, but if it arises - I have non-obvious errors in stdout after running my playbook (like "ansible_fqdn is not defined in host_vars", etc). My idea: r

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
четверг, 18 октября 2018 г., 11:34:25 UTC+3 пользователь Karl Auer написал: > > Try this: > > # Test random filter > - hosts: localhost > > tasks: > - name: Test random > set_fact: > rand_result: "{{ 5 |random }}" > with_sequence: count=10 > > Basically the change of item

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
plate evaluated once. How can I force reevaluate it on every iteration? чт, 18 окт. 2018 г. в 10:32, Pavel Martynov : > Hi! > > I want to wait for some DNS record registered in DNS server. For example, > A record. So I try to use this task: > > - name: Wait DNS A record ho

[ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
Hi! I want to wait for some DNS record registered in DNS server. For example, A record. So I try to use this task: - name: Wait DNS A record host.example.com registered set_fact: lookup_result: "{{ lookup('dig', 'host.example.com.') }}" until: lookup_result != 'NXDOMAIN' retries: 20

Re: [ansible-project] Re: Role interface design questions

2018-08-05 Thread Pavel Cahyna
kage (like "latest" state > presumes "present" state) or a cloud machine ("running" presumes "present" > state, also "stopped" state). > > On Thu, Jul 19, 2018 at 4:22 PM Terry Bowling wrote: > > > +ansible-project list for m

Re: [ansible-project] Is there a way to check if a service is already enabled on a linux machine?

2018-08-03 Thread Pavel Cahyna
On Fri, Aug 03, 2018 at 08:14:15AM -0500, Adam Miller wrote: > On Fri, Aug 3, 2018 at 7:52 AM yaakov.kuperman via Ansible Project > wrote: > > > > Awesome! Thanks! > > As an option, you can also use the service_facts module to inspect > service state: > https://docs.ansible.com/ansible/latest/mo

[ansible-project] Re: Error Msg: The pexpect python module is required

2017-01-24 Thread Pavel Voinov
I have similar problem but with a bit different outcome: Insufficient version of pexpect installed (4.2.1), this module requires pexpect>=3.3. Error was 'int' object has no attribute 'rstrip'" Ansible version:* 2.2.0.0* pexpect version: *4.2.1* (definitely greater than 3.3). On Tuesday, 29 Nov

[ansible-project] Re: chaining ssh and lxd connections

2016-06-30 Thread Pavel Stratil
yep, proxycommand came to my mind as well. still i'd love to keep the containers as simple as possible (without sshd running) and just connect to them via their connector, only not on local, but rather the remote host, so that i could define my inventory file along the lines of i.e. localhost a

[ansible-project] chaining ssh and lxd connections

2016-06-29 Thread Pavel Stratil
Hi, I wonder if/how is it possible to chain ssh and lxd connections in order to manipulate lxd/docker containers on remote physical servers thanks, Pavel -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

[ansible-project] Conditional variables

2016-06-14 Thread Pavel Stratil
Hey all, i'm trying to write a task to manage ssh keys. depending on that the ansible_user, i want teo work either in /root/.ssh or /home/$user/.ssh. So I naively googled how to do that and only ended confused with - set_fact: userdir="/home/{{ ansible_user }}" when: ssh_keygen_user != "roo

[ansible-project] How to template tasks file?

2015-11-23 Thread Pavel Vaysberg
Hey all, I am trying to repeat several tasks depending on how many servers I have in a certain group. Here is the code: {% for machine in groups['cluster_nodes'] %} - lineinfile: dest={{domain_home}}/servers/soa_server{{ loop.index + 1 }}/security/boot.properties create=yes line="username={{wls_

[ansible-project] Re: "ERROR: expecting dict" when trying to define a dictionary in my vars file

2015-11-10 Thread Pavel Vaysberg
Nevermind, I figured it out. The file that I was using to test the vars file was importing it using the "include" task, when I should have actually been using the include_vars module. It tried to open my vars like a file of tasks and gave me this error. -- You received this message because yo

[ansible-project] "ERROR: expecting dict" when trying to define a dictionary in my vars file

2015-11-10 Thread Pavel Vaysberg
Sorry if this is a beginner question, but I am having trouble defining a dictionary of key value pairs in my vars file for one of my roles. My purpose for packaging these pairs instead of just setting them as variables is so that I can cycle through them in my templates. Here is my code: # WebL

[ansible-project] Ansible support for IntelliJ IDEA Community

2015-05-21 Thread Pavel Veretennikov
I started to work on Ansible support for IntelliJ IDEA Community. First version is available on GitHub and Plugins repository . It is based on NEON plugin by juzna.cz. Currently provides: - Index of all r

[ansible-project] Re: Using registered variables and ec2 with_items

2015-04-23 Thread Pavel Georgiev
I have the same issue, need to instantiate multiple instances in different configuration, possibly more than one instance per configuration. Provisioning the instances works file but I don't know how to iterate over the result which is an array of hashes and I need to iterate over var[x].instan

[ansible-project] launch ec2 instance without instance_ids

2015-04-06 Thread Pavel Barmotin
Hello Guys, I want run stopped ec2 instance using count_tag and exact_count and not using instance_ids. - name: launch ec2 instance ec2: instance_type: m3.medium key_name: "{{ec2_key}}" group: web image: "{{ec2_ami}}" vpc_subnet_id: subnet-8c16c0d5 instance_tags:

[ansible-project] Disable host key checking when triggering Ansible from Python app

2014-12-17 Thread pavel
nsible-playbook - assembling a dictionary with the parameters It keeps asking if I want to continue connecting to the host. extra_vars is evaluated like this now: {u'host_key_checking': u'no', u'record_host_keys': u'no'} Could anyone advise please? Kind regards, Pav

[ansible-project] Globally pass variable

2014-10-12 Thread Zhukov Pavel
Is it possible to specify variable for a module to use it in every call of that module? E.g i have multiple calling to docker and docker_image modules inside playbook, but since i have a mac with docker inside VM, i should pass docker_url variable on EACH call of docker module. Is it possible t

[ansible-project] Re: Ansible XenServer VM Playbook & Guide Posted

2014-02-26 Thread Pavel Sakun
Hi Aaron. The link above gives 404, corrent one is http://sharknet.us/2013/12/13/276/ Pavel. On Wednesday, December 25, 2013 1:24:43 AM UTC+3, Aaron Hunter wrote: > > Hello, > > I just posted an in-depth guide to automating Xen VM creation and > provisioning using Ans