[ansible-project] Re: set_fact

2018-09-30 Thread Kuldip Madnani
with_items accepts a list. I don't understand the purpose of using with_items here. You can directly set cid as {{ group1.cid }} and env as {{ group1.env }} On Sunday, September 30, 2018 at 12:46:12 PM UTC-5, coach rhca wrote: > > Hi, > > I am trying to create a role in which i have variable

[ansible-project] Re: how to access dictionary key and value from group_vars it is not working

2018-09-30 Thread Kuldip Madnani
The group_vars directory contains files *for each hostgroup* defined in your inventory file. The files define variables that member hosts can use. So in your case the file should be group_vars/docker_con.yml On Sunday, September 30, 2018 at 6:19:02 PM UTC-5, Atul Sharma wrote: > >

[ansible-project] mySQL doesnt install on AWS EC2

2018-09-30 Thread adrian lee
I have 2 EC2 server instances where 1 I am using ansible to install mysql on the other ec2 instance. ISSUE TYPE Bug Report COMPONENT NAME - Installing mySQL on AWS EC2 Linux ANSIBLE VERSION ansible 2.6.5 CONFIGURATION So this is what I have so far - hosts: database sudo: yes

Re: [ansible-project] getting error when i set ssh-agent for root user

2018-09-30 Thread Dan Linder
If the ssh-agent must be running for your installer to complete, then you'll probably have to run it after the ssh-add: - name: Add and load private key to ssh-agent* and start installer* shell: "eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa* && /path/to/installer*" My gut feeling is that

[ansible-project] how to access dictionary key and value from group_vars it is not working

2018-09-30 Thread Atul Sharma
group_vars/vars.yml [root@master mywork]# cat group_vars/vars --- MyVariable: var1: 'hello' var2: 'world' inventory file: [mylocal] localhost [docker_con] con1 con2 [ofsaavar:children] mylocal docker_con [ofsaavar:vars] ansible_host=con1 ansible_host=con2 ansible_ssh_user=root to

Re: [ansible-project] getting error when i set ssh-agent for root user

2018-09-30 Thread Dan Linder
The "ssh-agent" and "ssh-add" are usually run on a system as a specific user to add an SSH key to a temporary 'keychain' so any subsequent SSH commands can automatically (and without prompting) use a specific ssh key to connect to a second system. When you run them in the Ansible "shell"

Re: [ansible-project] Disk informatoin in target machine

2018-09-30 Thread vinoth kumar
Forget to mention it. It gives me an error On Sun, 30 Sep 2018 at 10:58 PM, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On Sunday, 30 September 2018 18.46.58 CEST vinod93...@gmail.com wrote: > > HI kai,, > > > > Thanks for your information, > > > > sorry to ask this again, Here

Re: [ansible-project] set_fact

2018-09-30 Thread Kai Stian Olstad
On Sunday, 30 September 2018 19.46.12 CEST coach rhca wrote: > I am trying to create a role in which i have variable file ( main.yml) > under vars folder containing > > --- > group1: > cid: t1234 > env: uat > status: active > > > and in the tasks (main.yml ) i have > --- > -

[ansible-project] set_fact

2018-09-30 Thread coach rhca
Hi, I am trying to create a role in which i have variable file ( main.yml) under vars folder containing --- group1: cid: t1234 env: uat status: active and in the tasks (main.yml ) i have --- - name: setting values set_fact: cid: "{{item.cid}}" env : "{{item.env}}"

Re: [ansible-project] Disk informatoin in target machine

2018-09-30 Thread Kai Stian Olstad
On Sunday, 30 September 2018 18.46.58 CEST vinod93...@gmail.com wrote: > HI kai,, > > Thanks for your information, > > sorry to ask this again, Here getting this below output, but not even a > proper one , anything wrong I did?, /dev/sdi is free disk. is that right > one, output will be in

Re: [ansible-project] Disk informatoin in target machine

2018-09-30 Thread vinod93pop
HI kai,, Thanks for your information, sorry to ask this again, Here getting this below output, but not even a proper one , anything wrong I did?, /dev/sdi is free disk. is that right one, output will be in descending order? bash -c 'comm -23 <(lsblk -snlo name) <(lsblk -l | grep part | cut

[ansible-project] Re: Disk informatoin in target machine

2018-09-30 Thread vinod93pop
HI K On Sunday, September 30, 2018 at 4:57:12 PM UTC+2, vinod...@gmail.com wrote: > > HI all, > > I am trying to get the disk information of target machine. > > 1. I want to check the newly added disk which is fully free, means there > is no partition created. > 2. running a loop like /dev/sda

Re: [ansible-project] Disk informatoin in target machine

2018-09-30 Thread vinod93pop
HI kai,, Thanks for your information, sorry to ask this again, Here getting this below output, but not even a proper one , anything wrong I did?, /dev/sdi is free disk. is that right one, output will be in descending order? bash -c 'comm -23 <(lsblk -snlo name) <(lsblk -l | grep part | cut

Re: [ansible-project] Disk informatoin in target machine

2018-09-30 Thread Kai Stian Olstad
On Sunday, 30 September 2018 16.57.12 CEST vinod93...@gmail.com wrote: > HI all, > > I am trying to get the disk information of target machine. > > 1. I want to check the newly added disk which is fully free, means there is > no partition created. > 2. running a loop like /dev/sda to /dev/sdz

[ansible-project] Disk informatoin in target machine

2018-09-30 Thread vinod93pop
HI all, I am trying to get the disk information of target machine. 1. I want to check the newly added disk which is fully free, means there is no partition created. 2. running a loop like /dev/sda to /dev/sdz and that should fail if patition is not created and print the me last failed disk.

Re: [ansible-project] getting error when i set ssh-agent for root user

2018-09-30 Thread pranay varankar
Hi Jonathan, I use below task in my playbook, - name: Add and load private key to ssh-agent shell: "eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa" When i run playbook no error found, [image: image.png] But I log in to my client machine and type "ssh-add -l" command then I get below error