[ansible-project] Re: Multi-tenant best practices for Ansible Tower

2019-05-28 Thread Adam E
Check out https://docs.ansible.com/ansible-tower/latest/html/userguide/organizations.html to see if it meets your needs. Your post should be posted to the awx project forum https://groups.google.com/forum/#!forum/awx-project On Monday, May 27, 2019 at 10:49:19 AM UTC-7, dimple rohara wrote:

[ansible-project] Re: Running ansible tasks in background and disown

2019-05-15 Thread Adam E
not sure if you would get different results, but maybe try nohup instead of disown. ie. - name: execute sar iostat scripts shell: nohup top -bd $MON_INTERVAL > $GLUSTER_PROFILER_RESULTS/top_proc.$HOSTNAME.txt & Another option could be to use the "at" module to schedule a task to start

[ansible-project] ansible_python_interpreter facts.d

2019-05-13 Thread Adam E
Hi there. On a few old/legacy systems I have installed python 2.6 in a nondefault location whereas the "default" (path) is an older version such as 2.4. In some cases I have legacy apps that may need the old version and I don't want to affect their environment. Setting

[ansible-project] Re: Pass a variable in "vars_file" to "with_items" from command prompt as part of "extra-vars"

2019-05-10 Thread Adam E
Not sure if it meets your needs, but why not do something like this: - hosts: localhost > vars: > docker_configs: > tomcat: { cName: 'tomcatImg', iName: 'tomcat:latest', iPort: , > volumes: '/temp' } > nginx: { cName: 'nginxImg', iName: 'nginx:latest', iPort: 8001, >

Re: [ansible-project] $PATH with shell is different to manual ssh

2019-05-09 Thread Adam E
I deal with a lot of legacy systems that don't always have great path defaults for working with Ansible. I ended up putting the following at the top of my main playbook to add some common locations to the path if they were not present. Might help in your case if you can't easily modify the

Re: [ansible-project] multiline jinja2 lists returned as string?

2019-05-08 Thread Adam E
of a block (e.g. a For tag), a comment, or a > variable expression, the whitespaces before or after that block will be > removed > > On Wed, May 8, 2019 at 3:43 PM Adam E > > wrote: > >> thanks for the reply, I had also thought of that solution and it's >> perfectly

Re: [ansible-project] multiline jinja2 lists returned as string?

2019-05-08 Thread Adam E
and the crux of what I was after was how to nicely do complex multiline jinja statements that use lists. On Wednesday, May 8, 2019 at 1:11:43 PM UTC-7, Kai Stian Olstad wrote: > > On 03.05.2019 22:15, Adam E wrote: > > Hi there, I have some logic that I want to apply when creati

[ansible-project] multiline jinja2 lists returned as string?

2019-05-03 Thread Adam E
Hi there, I have some logic that I want to apply when creating assigning a list to a variable. See my sample playbook below, Ideally i'd like a nice clean way to have a logic based list. the "users" approach works, however it's always interpreted as a string. The only solution I can think of

Re: [ansible-project] Re: Ansible how to subtract two variables in a playbook?

2019-04-30 Thread Adam E
I can echo > with the shell module what is the -r any way ? > > > > On Tue, Apr 30, 2019 at 12:42 PM Adam E > > wrote: > >> You could run a "shell" command and register the output to a variable >> using a command something like the following: >

[ansible-project] Re: Ansible how to subtract two variables in a playbook?

2019-04-30 Thread Adam E
You could run a "shell" command and register the output to a variable using a command something like the following: echo $((($(date +%s) - $(date +%s -r "$filename")) / 86400)) Alternatively, you could develop a action_plugin that

[ansible-project] Re: How to mask connection string Passwords while connecting through DB using sqlplus ansible

2019-04-30 Thread Adam E
you could also look at using oracle wallet if you don't want to use environment variables for some reason. https://docs.oracle.com/cd/B19306_01/network.102/b14266/cnctslsh.htm#g1033548 On Monday, April 29, 2019 at 4:04:37 PM UTC-7, Raj wrote: > > I am running into an issue where ansible is

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

2019-04-16 Thread Adam E
I do something similar, I just use the assert module to check a fact that I know should be set to a predefined value. - name: "linux : global assertions" assert: that: - "group_ld_all_000_global_defaults == 'loaded'" fail_msg: 'environment issue, please double check,

[ansible-project] list containing any item of another list

2019-04-03 Thread Adam E
Hi, wondering if there is any cleaner way to see if two lists have 1 or more intersecting values? the following works for me # returns true > {{ ['value1', 'value2'] | intersect(['value1', 'value2']) | length > 0 }} > # returns false > {{ ['value3', 'value4'] | intersect(['value1', 'value2']) |

Re: [ansible-project] Re: Importing user variables from multiple variable sources

2019-03-21 Thread Adam E
another alternative if you don't want to use an external plugin is to predefine your variable names and then combine them.. ie... > users_global > users_group users_host (variable you set in host_vars) and then use the "combine

Re: [ansible-project] Re: getting a variable indirectly

2019-03-14 Thread Adam E
i'm not sure if it would work on that old version, but couldn't you just copy the vars plugin file into your local "lookup_plugins" directory? On Tuesday, March 12, 2019 at 6:41:12 AM UTC-7, fusillator wrote: >

Re: [ansible-project] rpm-python centos5 package package_facts

2019-03-08 Thread Adam E
ng the inventory variable >> "ansible_python_interpreter" for them to the path of the alternate >> python interpreter. >> >> On Fri, Mar 8, 2019 at 2:25 PM Adam E > >> wrote: >> > >> > hey there, i'm trying to manage a bunch of centos5/rh

Re: [ansible-project] rpm-python centos5 package package_facts

2019-03-08 Thread Adam E
hon interpreter. > > On Fri, Mar 8, 2019 at 2:25 PM Adam E > > wrote: > > > > hey there, i'm trying to manage a bunch of centos5/rhel5 systems with > ansible 2.7.5 > > > > On the target host I am able to install python 2.6 from epel which is > all go

[ansible-project] rpm-python centos5 package package_facts

2019-03-08 Thread Adam E
hey there, i'm trying to manage a bunch of centos5/rhel5 systems with ansible 2.7.5 On the target host I am able to install python 2.6 from epel which is all good and ansible runs just fine for most stuff. The issue is with anything related to packages (ie . package_facts and package). They

[ansible-project] Re: Importing user variables from multiple variable sources

2019-03-02 Thread Adam E
I have a similar issue and solved it by this PR https://github.com/ansible/ansible/pull/51466 . if you want to use it, just grab the source code and add it to your local library directory until it's merged. Also see this thread

Re: [ansible-project] skip_unreachable ?

2019-02-27 Thread Adam E
est" hosts: "*:!unreachable_hosts" become: no tasks: - name: "success1" copy: content: "my stuff" dest: /tmp/file.success1 On Wednesday, February 27, 2019 at 2:41:31 PM UTC-8, Adam E wrote: > > hi Brian, I was wondering if ther

Re: [ansible-project] skip_unreachable ?

2019-02-27 Thread Adam E
hi Brian, I was wondering if there is anything else you can suggest to me. I want to report a successful ansible run when the only thing that failed were unreachable hosts so that it returns success back to AWX. Is there a callback plugin or some local customization that I can write in

[ansible-project] merging specific group_vars without changing global behavior

2019-01-29 Thread Adam E
In my environment i have a group_vars structure something like the following: [global:children] datacenter1 [datacenter1:children] network_zone1 network_zone2 [network_zone1] server1 [network_zone2] server2 so using a simple case where I want to add entries to /etc/hosts (although there

[ansible-project] Re: need ansible to wait for a springboot acutuator heathcheck to show up

2019-01-25 Thread Adam E
something like this should work - name: "wait for status" shell: bash -c 'curl -s http://{{ server_name }}: *8093/service/actuator/health* |egrep "^status"' register: cmd_res retries: "60" delay: 1 until: cmd_res.stdout.find('"status": "UP") != -1 On Friday, January 25, 2019 at

[ansible-project] Options for filtering hosts

2019-01-23 Thread Adam E
If you happen to be using awx, you can enable fact caching and then create a dynamic inventory which can be based on search results including facts values -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

Re: [ansible-project] skip_unreachable ?

2019-01-16 Thread Adam E
thanks for the reply Brian. Yes, it sounds like clear_host_errors i think will be too big of a hammer, I just want to ignore unreachable. I'll have to figure something else out then, have a couple other scenarios in mind anyways, gonna also look at something like

[ansible-project] skip_unreachable ?

2019-01-15 Thread Adam E
Hi there. My scenario is that I have a hundreds of locations on various different networks that I want to run some plays against. In almost all circumstances I will have 2-3% of these sites that I cannot connect to due to network related issues.I don't want to create exceptions/errors in