[ansible-project] Ansible Ad-hoc Command

2019-02-28 Thread Bipin Guragain
Hi All I am new to Ansible and started using it for a while. I have one question on Ansible Ad-hoc command using a shell module with a passed args 'chdir'. I am having a problem using the argument 'chdir' in Ansible CLI. The same works if i try to include in my playbook but don't know why it

[ansible-project] How to store ansible running log separately without touching log_path and ANSIBLE_LOG_PATH

2019-02-28 Thread Qin Peter
Hi All, I am new to Ansible and I have requirement about ansible running log. Could anyone help? Thanks. I am talking about running log, not the playbook log. eg: 2019-02-28 01:39:59,819 p=23627 u=peterqi | PLAY [create log file]

[ansible-project] Defning cloudwatch metric alarm which uses metric math using ansible ec2_metric_alarm

2019-02-28 Thread Tony Chia
Maybe try using terraform ? I find the terraform module for aws is usually more update than ansible’s aws module Regards Tony -- 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

[ansible-project] creating a vm using ovf and vmdk files

2019-02-28 Thread Sahar
*I'm trying to create VM using the following ansible module. To create it, I see "ovf" as attributes that I can use the path to the ovf files, but I don't see any attribute to let me use my vmdk files.* *Do you know where I can specify my vmdk files?* - vmware_deploy_ovf: hostname: '{{

[ansible-project] Defning cloudwatch metric alarm which uses metric math using ansible ec2_metric_alarm

2019-02-28 Thread Sachin Doiphode
I'm using ansible's ec2_metric_alarm for creating CloudWatch metrics alarms. now, I have some metrics defined which uses metric math

Re: [ansible-project] Combine values from multiple lists

2019-02-28 Thread Kai Stian Olstad
On 28.02.2019 21:02, Ryan wrote: > Sorry, the output is from stdout_lines. here is the section. > > - lineinfile: > line: "{{ item }}" > path: "{{ log }}" > > with_together: > > - "{{ memoryLocator.stdout_lines }}" > > - "{{ memoryPN.stdout_lines }}" > > - "{{

[ansible-project] Re: Guidelines for writing cross platform roles

2019-02-28 Thread Elan
Thank you for your answer. :) I was afraid that there wasn't a way to go without "if"s on low levels and it is only possible by separating it to playbooks. Looks like I will need to redesign my project structure to account that. четверг, 28 февраля 2019 г., 15:49:58 UTC+1 пользователь Jeffrey

Re: [ansible-project] Combine values from multiple lists

2019-02-28 Thread Ryan
Sorry, the output is from stdout_lines. here is the section. - lineinfile: line: "{{ item }}" path: "{{ log }}" with_together: - "{{ memoryLocator.stdout_lines }}" - "{{ memoryPN.stdout_lines }}" - "{{ memorySN.stdout_lines }}" The output to the log: ['DIMM1',

Re: [ansible-project] Hostvars to pull specific variables

2019-02-28 Thread Kai Stian Olstad
On 28.02.2019 14:35, Jeffrey Agnitsch wrote: > > - hosts: proxy >tasks: > >- debug: msg="{{ item['client_name'] }}" > with_items: "{{ groups['apps'] }}" Sorry about that it should of course be - debug: msg="{{ hostvars[item]['client_name'] }}" with_items: "{{ groups['apps']

Re: [ansible-project] When Condition check is not working in a list as expected.

2019-02-28 Thread Kai Stian Olstad
On 28.02.2019 13:52, Pandu jh wrote: > When Condition check is not working in a list as expected. > > My requirement is > > Playbook should not fail If all the three mentioned variables have > "no_share" value. > But it's failing not sure what causing this issue. > > > > - debug:

Re: [ansible-project] Combine values from multiple lists

2019-02-28 Thread Kai Stian Olstad
On 28.02.2019 01:27, Ryan wrote: > Thanks, that worked well. I am writing this information to a file using > lineinfile. How would I strip off the brackets, quotes and commas? > ['DIMM1', 'G5-111', '999000123'] I'm not sure what you do, but with_together don't produce a list, that must be

[ansible-project] Re: vmware delete old snapshot

2019-02-28 Thread John Foley
Just delete them all :) Having a slew of snapshots of bad business anyway. On Thursday, February 28, 2019 at 2:15:02 AM UTC-5, itfor...@gmail.com wrote: > > Hi all, > > May I ask how do you handle deleting old snapshots in vmware? > > vmware_guest_snapshot module seems to be based on the name

[ansible-project] Re: Guidelines for writing cross platform roles

2019-02-28 Thread Jeffrey Agnitsch
What type of OS's are you referring to ? If you are staying within the realm of Linux's you can gather facts and then do when statement. It might also be good to just create separate named roles for the different OS. - name: Copy | Copy Repo copy:

Re: [ansible-project] Hostvars to pull specific variables

2019-02-28 Thread Jeffrey Agnitsch
> > When running the command it stated there was an undefined variable I made > the below changes to the playbook > => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'client_name'\n\nThe

Re: [ansible-project] Re: Vault encrypting password over the network or just locally

2019-02-28 Thread boncalo mihai
Obvious...my bad, stupid uquestion On Thu, Feb 28, 2019 at 12:45 AM Kai Stian Olstad wrote: > > On 27.02.2019 23:35, boncalo mihai wrote: > > Does anyone know? > > > > On Mon, Feb 25, 2019, 3:34 PM boncalo mihai wrote: > > > >> Hi, > >> > >> I'm trying to secure my ansible playbook and one of

[ansible-project] When Condition check is not working in a list as expected.

2019-02-28 Thread Pandu jh
When Condition check is not working in a list as expected. My requirement is Playbook should not fail If all the three mentioned variables have "no_share" value. But it's failing not sure what causing this issue. - debug: var=open_shares_info - debug: var=linked_dirs_list -

Re: [ansible-project] Skip import playbook using when condition.

2019-02-28 Thread Pandu jh
Ok, Thank you James On Thursday, 28 February 2019 00:37:21 UTC+5:30, James Cassell wrote: > > On Wed, Feb 27, 2019, at 1:43 PM, Pandu jh wrote: > > > > If there are no hosts added to add host, subsequent plays should be > > skipped. Please let me know how to provide when condition for this >

[ansible-project] Guidelines for writing cross platform roles

2019-02-28 Thread Elan
Recently I have been watching some ansible conference recordings and reading about best practices and I have a question. How do you write your playbooks/roles to for cross platform use and be able to not to turn your specification to code with frequent "if"s and to not write too much

[ansible-project] How show first line in file

2019-02-28 Thread ryad9200000
Hy all, I have a file with : 1 . ma premiere ligne 2 . ma deuxieme ligne How show only first line in this file : 1 . ma premiere ligne Thank you guy !! ;) -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

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

2019-02-28 Thread Suhail Choudhury
Has anyone come across this before? Surely it must be a common ask. On Wednesday, 27 February 2019 15:15:59 UTC, Suhail Choudhury wrote: > > Hi, > > I want to know how I can import user account variables at multiple levels > using loops/arrays and importing them all. > > i.e. i have a generic

Re: [ansible-project] expect Module in Ansible

2019-02-28 Thread Deepak Sharma
Please ignore previous mail Hi Hugo, We are using conda forge, and pexpect is already installed , we are using Jenkins pipeline to configure by using below environment file . channels: - conda-forge - defaults dependencies: - python=2.7.15 - ansible=2.7.1 conda-forge::pexpect-4.6.0-py27_1000

Re: [ansible-project] expect Module in Ansible

2019-02-28 Thread Deepak Sharma
Hi Hugo, We are using conda forge, and pexpect is already installed , but no clue when it will finish . conda-forge::pexpect-4.6.0-py27_1000 Regards, Deepak On Wed, Feb 27, 2019 at 3:36 PM Hugo Gonzalez wrote: > Hello Deepak, > On 2/27/19 7:43 AM, Deepak Sharma wrote: > > >> >> I am using

[ansible-project] Re: Get indice in file if caracter present

2019-02-28 Thread ryad9200000
Uppp pleasee !!! Le mercredi 27 février 2019 17:35:40 UTC+1, ryad9...@gmail.com a écrit : > > Hy all, > > I have one file with this content: > > 1,user1,host1,appli1 > 2,user2,host2,appli2 > > My problem is that i want an task who look if {{ > ansible_user}},{{inventory_hostname}} ==