[ansible-project] Any ansible module to JBOSS Explode ear file in the target server

2019-09-26 Thread Mona Gopal
Hi,

I have a ear file in my local.
And this needs to be exploded on the target machine.
Apart from the unarchive module. Is there any JBOSS explode option in 
Ansible?

Thanks in advance,
Mona

-- 
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/50dd398b-9c46-4613-87b2-5c60a44e0d83%40googlegroups.com.


[ansible-project] Dictionary Parsing

2018-02-13 Thread Mona Gopal


We are trying to write Ansible playbooks for releasing patches for an 
application

In patch releases there are 4 basic changes that can be there 

We will create 4 roles for those

BinaryRole : For changing war files and jar files with backup and replacing 
the existing configurations

ConfigRole: For adding / deleting / modifying parameters from the 
configuration files with backup 

DBRole : For changes related to DB . SQL source file will be used 

NonCompile: For replacing static files like JSPs or Resource_Properties

 

While working on the ConfigRole I am using the dictionary variables for 
defining files and parameters will require change in those files

The parameters can be either added or modified or removed from the config 
file

Below is the dictionary variable that I have defined and the corresponding 
task that I have used that variable in

 

*Inside group_vars file*

 

configFiles:


/home/BM/apache-tomcat-8.0.35/webapps/OBDReport/WEB-INF/classes/COMMON.properties:

   paramName: DB_USER

   paramValue: dbansible

   change: 3

 

*Inside playbook in ConfigRole*

 

- name: change configurations modified

  lineinfile: dest={{ item.key }} regexp='^{{ item.value.paramName }}=' 
line={{ item.value.paramName }}={{ item.value.paramValue }}

  when: "{{ item.value.change }}|int==3"

  with_dict: "{{ configFiles | default({}) }}"

 

- name: change configurations added

  lineinfile: dest={{ item.key }} line={{ item.value.paramName }}={{ 
item.value.paramValue }}

  when: "{{ item.value.change }}|int==2"

  with_dict: "{{ configFiles | default({}) }}"

 

In the above task based on the change value parameters will be modified for 
value 3 and added for value 2

While looping over the dictionary configFiles:   ansible is able to read 
only one value of every key 

Here key is 
/home/BM/apache-tomcat-8.0.35/webapps/OBDReport/WEB-INF/classes/COMMON.properties
 
and value is the set of values (paramName , paramValue, change )

If there are multiple parameters in the same file which require change then 
how do we define those in the group_vars file and how to loop through the 
same in the task file in the role

 

If I write the vars as below

configFiles:


/home/BM/apache-tomcat-8.0.35/webapps/OBDReport/WEB-INF/classes/COMMON.properties:

   paramName: DB_USER

   paramValue: dbansible

   change: 3

   paramName: DB_USER_1

   paramValue: dbansible1

   change: 2

Then it will only read the last set of values for each key.

Please help in resolving this or suggest if we can use some other approach


Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b0e4896-bea1-4adb-aafe-099614f13390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: msg: Failed to find required executable mysql

2018-01-23 Thread Mona Gopal
Hi, 


We are facing similar issue. The only difference being this error occurs at 
all times. Also to mention we are running this playbook on an AWS instance. 
On other servers and VM's it has worked before.
Any help would be appriciated.

Thanks in advance,
Mona 

On Thursday, December 11, 2014 at 3:28:14 PM UTC+5:30, Marti Butler wrote:
>
> Hi
>
> I am importing an SQL file into my already created DB but getting the 
> above error:
>
> - name: import database 
>   mysql_db: name=DB state=import target=DB.sql login_user=root 
> login_host=localhost login_unix_socket=/var/lib/mysql/tmp/mysqld 
> login_password=''
>
> Error:
> msg: Failed to find required executable mysql
>
> When I run this again it is fine and imports correctly.  Anybody else been 
> having this issue please?
>
> Thanks
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8ff6720d-4c6b-4028-85b0-fab4b1104b88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible 2.4 gathering facts stuck

2017-12-12 Thread Mona Gopal
Hi,

Ansible2.4 is setup on CentOS7.4. 
The playbook execution gets stuck(for more than 5 mins) at gathering facts 
at times and few of the times it runs smoothly. 
What could be the reason for it? 

Regards,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cca72bb6-50ad-4d65-a792-04025fd4809c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Control Ansible Logs

2017-07-18 Thread Mona Gopal
Hello,

is there any way to suppress some part of the log which is printing on 
console while Ansible playbook execution.I want to fetch only the output 
returned from the script.


I do not prefer to see the following output on the console.

PLAY [Apply the following configuration on all hosts]
 *
GATHERING FACTS 
***
ok: [172.19.7.113]
TASK: [Execute]
 ***
changed: [172.19.7.113]
TASK: [shell echo '"\{\{ansible_default_ipv4.address}} 
\{\{user.stdout_lines}}"' >> /home/ansi.log] ***
changed: [172.19.7.113 -> 127.0.0.1]
TASK: [debug ]
 
ok: [172.19.7.113] => {
"msg": "172.19.7.113 ['root']"
}
PLAY RECAP 

172.19.7.113 : ok=4 changed=2 unreachable=0 failed=0


Is there any other alternative apart from setting  no_log: true for every 
task??

May be going ahead I would want to see the logs of the task for which the 
status is  changed and ignore the "ok" tasks.


Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fa948f22-ea98-440f-9eb4-df1440b6d5f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Lineinfile + insertafter

2017-06-02 Thread Mona Gopal
Hello,
The task is as below:
- name: replace
  lineinfile:
dest: /tmp/sample/test_file.txt
regexp: "#}"
insertafter: '\"compute\": 2,'
line: "}"
state: present


And below is my file content:

#OPENSTACK_API_VERSIONS = {
#"data-processing": 1.1,
#"identity": 3,
#"image": 2,
#"volume": 2,
#"compute": 2,
*#}*

#PROJECT_TABLE_EXTRA_INFO = {
#   'phone_num': _('Phone Number'),
#}
#USER_TABLE_EXTRA_INFO = {
#   'phone_num': _('Phone Number'),
#}

*EXPECTED RESULT: *

 

OPENSTACK_API_VERSIONS = {

"data-processing": 1.1,

"identity": 3,

"image": 2,

"volume": 2,

"compute": 2,

}

 

#PROJECT_TABLE_EXTRA_INFO = {

#   'phone_num': _('Phone Number'),

#}

#USER_TABLE_EXTRA_INFO = {

#   'phone_num': _('Phone Number'),

#}

 

*CURRENT RESULT:*

 

OPENSTACK_API_VERSIONS = {

"data-processing": 1.1,

"identity": 3,

"image": 2,

"volume": 2,

"compute": 2,

#}

 

#PROJECT_TABLE_EXTRA_INFO = {

#   'phone_num': _('Phone Number'),

#}

#USER_TABLE_EXTRA_INFO = {

#   'phone_num': _('Phone Number'),

}


The line mentioned in insertafter is not recognized. Kindly, suggest a way 
forward.


Regards,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0c8c3964-dc99-421a-a81c-f3d38e1bd565%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-27 Thread Mona Gopal
Hey Smooge,

Thanks for the reply!!
Will surely try out the link sent :)
Even we have just one box to test this on hence the IT does the trial and 
errors. :D
Will get back to you on this.

Regards,
Mona 

On Monday, March 27, 2017 at 8:31:12 PM UTC+5:30, Smooge wrote:
>
> On 7 March 2017 at 02:49, Mona Gopal > 
> wrote: 
> > Hello, 
> > 
> > I need ansible to be installed on AIX 6.1 and 7.1. 
> > Kindly provide the pre-requisites and steps for installation of ansible 
> > 
> > Also, would it require any changes to be done in the playbook? 
> > 
> > Have been referring to the below link, but hasn't been of much help: 
> > https://www.djouxtech.net/posts/ansible-on-aix/ 
> > 
> > Kindly suggest a way forward ASAP 
> > 
>
> So the instructions look to be lacking in some key steps of getting 
> ansible installed. You will probably need to get the python-setuptools 
> package and then look at the steps at 
> https://github.com/nodejs/build/issues/533 
>
> I would do the following: 
> 1. Get a test instance to make sure this isn't going to eat your systems 
> brains 
> 2. download https://bootstrap.pypa.io/get-pip.py 
> Note: I don't like the fact that the blob has no gpg signature or 
> sha256sum etc to say "Hey we really put this up here for you". I would 
> prefer to give you anything else.. but I don't have any AIX systems to 
> build rpms on so ¯\_(ツ)_/¯ 
> 3. examine that blob as best you can... 
> 4. python get-pip.py 
> 5. See if that works and didn't eat your test system or join a zombie 
> horde of aix systems. 
> 6. install ansible on the test box and work from there. 
>
>
>
>
> > Regards, 
> > Mona G 
> > 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/c1c0b1f0-90f3-4f7a-abc4-df16896ee78e%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Stephen J Smoogen. 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/740f9168-6884-4c52-a3f9-8329796f3564%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-27 Thread Mona Gopal
Hey Greg,

Thanks for the reply :)
I am trying to do both (1) and (2) as mentioned by you.
Earlier we were trying to connect to the remote(AIX) machines from a linux 
box. We have been successful in doing so.
However, the connectivity being poor, the plan changed to setting up 
ansible on the AIX machine itself. There by making it easier to deploy. 
And in the process we are facing difficulty to get pip(to install ansible) 
on that AIX machine. We are new to an AIX environment and hence facing 
these basic difficulties.

Regards,
Mona G

On Monday, March 27, 2017 at 8:47:51 PM UTC+5:30, Greg DeKoenigsberg wrote:
>
> On Mon, Mar 27, 2017 at 11:04 AM, Mona Gopal  > wrote: 
> > I am trying to  install ansible on AIX 7.1 machine 
>
> You need to be more specific. 
>
> Ansible is a program that manages other systems via SSH. 
>
> Are you (1) using an AIX system to run Ansible *from*, or (2) do you 
> want to use Ansible to manage AIX hosts? 
>
> If the answer is (2), then you don't need to install Ansible itself on 
> the AIX hosts. You need to install Ansible on the system that will 
> connect to those hosts, and the target hosts only need Python and SSH. 
>
> And if the answer is (1), you're trying to install Ansible on an AIX 
> system itself... why? 
>
> --g 
>
> > On Mar 27, 2017 8:32 PM, "Dick Visser" > 
> wrote: 
> >> 
> >> On 27 March 2017 at 14:02, Mona Gopal  > wrote: 
> >> > Hey Jon, 
> >> > 
> >> > The link doesn't give an explanation on setting up Ansible. It only 
> >> > guides 
> >> > to setup python. 
> >> > The python setup has been done. However, unable to install pip which 
> >> > would 
> >> > help me in installing Ansible. 
> >> 
> >> In case it is not obvious. 
> >> "Installing ansible" refers to installing the ansible software onto a 
> >> management station. 
> >> This require python, and pip can be used for that. 
> >> 
> >> From that management station you can then use the ansible software to 
> >> manage other systems - such as AIX systems. 
> >> 
> >> https://www.djouxtech.net/posts/ansible-on-aix/ describes how to 
> >> manage AIX systems. 
> >> 
> >> From comments (unable to install pip) it seems that you have trouble 
> >> getting ansible on your management station (which might or might not 
> >> be AIX). 
> >> 
> >> 
> >> Still confused: what are you trying to do? 
> >> 
> >> 
> >> -- 
> >> Dick Visser 
> >> Sr. System & Network Engineer 
> >> GÉANT 
> >> 
> >> Want to join us? We're hiring: https://www.geant.org/jobs 
> >> 
> >> -- 
> >> You received this message because you are subscribed to a topic in the 
> >> Google Groups "Ansible Project" group. 
> >> To unsubscribe from this topic, visit 
> >> 
> https://groups.google.com/d/topic/ansible-project/Vz3mjJ-f1rg/unsubscribe. 
>
> >> To unsubscribe from this group and all its topics, send an email to 
> >> ansible-proje...@googlegroups.com . 
> >> To post to this group, send email to ansible...@googlegroups.com 
> . 
> >> To view this discussion on the web visit 
> >> 
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwPxG4EOfHuVwF7b-VShnoAjmbpNWab2wEWUyZQozeujog%40mail.gmail.com.
>  
>
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/CAAkFYjZs16k5LHH8DG7qNVyscHMz9d%2BjDynDi7SQc3-NJ4O6OA%40mail.gmail.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Greg DeKoenigsberg 
> Ansible Community Guy 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/23107d73-0ed0-4272-adc9-4b11a6576863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-27 Thread Mona Gopal
Hey Dick!!

To clarify the confusions.
I am trying to  install Ansible software on an AIX machine.
In the process of setting up ansible, i am facing difficulties to install 
pip on this AIX box.

NOTE: The remote machines which i am going to connect to are also AIX 
machines. 

Regards,
Mona 

On Monday, March 27, 2017 at 8:31:59 PM UTC+5:30, Dick Visser wrote:
>
> On 27 March 2017 at 14:02, Mona Gopal > 
> wrote: 
> > Hey Jon, 
> > 
> > The link doesn't give an explanation on setting up Ansible. It only 
> guides 
> > to setup python. 
> > The python setup has been done. However, unable to install pip which 
> would 
> > help me in installing Ansible. 
>
> In case it is not obvious. 
> "Installing ansible" refers to installing the ansible software onto a 
> management station. 
> This require python, and pip can be used for that. 
>
> From that management station you can then use the ansible software to 
> manage other systems - such as AIX systems. 
>
> https://www.djouxtech.net/posts/ansible-on-aix/ describes how to 
> manage AIX systems. 
>
> From comments (unable to install pip) it seems that you have trouble 
> getting ansible on your management station (which might or might not 
> be AIX). 
>
>
> Still confused: what are you trying to do? 
>
>
> -- 
> Dick Visser 
> Sr. System & Network Engineer 
> GÉANT 
>
> Want to join us? We're hiring: https://www.geant.org/jobs 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6bec40e7-159c-4140-8c09-532735541c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-27 Thread Mona Gopal
I am trying to  install ansible on AIX 7.1 machine

On Mar 27, 2017 8:32 PM, "Dick Visser"  wrote:

> On 27 March 2017 at 14:02, Mona Gopal  wrote:
> > Hey Jon,
> >
> > The link doesn't give an explanation on setting up Ansible. It only
> guides
> > to setup python.
> > The python setup has been done. However, unable to install pip which
> would
> > help me in installing Ansible.
>
> In case it is not obvious.
> "Installing ansible" refers to installing the ansible software onto a
> management station.
> This require python, and pip can be used for that.
>
> From that management station you can then use the ansible software to
> manage other systems - such as AIX systems.
>
> https://www.djouxtech.net/posts/ansible-on-aix/ describes how to
> manage AIX systems.
>
> From comments (unable to install pip) it seems that you have trouble
> getting ansible on your management station (which might or might not
> be AIX).
>
>
> Still confused: what are you trying to do?
>
>
> --
> Dick Visser
> Sr. System & Network Engineer
> GÉANT
>
> Want to join us? We're hiring: https://www.geant.org/jobs
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/Vz3mjJ-f1rg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CAL8fbwPxG4EOfHuVwF7b-VShnoAjmbpNWab2wEWUyZQozeujog%
> 40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAkFYjZs16k5LHH8DG7qNVyscHMz9d%2BjDynDi7SQc3-NJ4O6OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-27 Thread Mona Gopal
Hey Jon,

The link doesn't give an explanation on setting up Ansible. It only guides 
to setup python.
The python setup has been done. However, unable to install pip which would 
help me in installing Ansible.
Any easier approach available?? 

Regards,
Mona G


On Thursday, March 9, 2017 at 1:31:05 PM UTC+5:30, Jon Stanley wrote:
>
> On Tue, Mar 7, 2017 at 2:49 AM, Mona Gopal  > wrote: 
> > 
> > Have been referring to the below link, but hasn't been of much help: 
> > https://www.djouxtech.net/posts/ansible-on-aix/ 
>
> Not an AIX expert (or even novice), but in what way has this not been 
> of help? It explains what the pre-requisites are (a working Python 2 
> interpreter - and how to get there on AIX) and SSH. What part of that 
> are you having problems with? What error messages are produced? 
>
> A more specific inquiry is more likely to yield solutions. 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6359d04b-76a1-4390-b0d5-93f2fed305a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installing Ansible on AIX

2017-03-07 Thread Mona Gopal
Hi Dick,

Firstly, thanks for the reply.
And sorry the url doesn't refer to ansible installation on AIX box.
and my requirement is to setup ansible on AIX 7.1 machine.

Thanks in advance,
Mona

On Tuesday, March 7, 2017 at 5:47:13 PM UTC+5:30, Dick Visser wrote:
>
> On Tue, 7 Mar 2017 at 08:49, Mona Gopal > 
> wrote: 
> > 
> > Hello, 
> > 
> > I need ansible to be installed on AIX 6.1 and 7.1. 
> > Kindly provide the pre-requisites and steps for installation of ansible 
> > 
> > Also, would it require any changes to be done in the playbook? 
> > 
> > Have been referring to the below link, but hasn't been of much help: 
> > https://www.djouxtech.net/posts/ansible-on-aix/ 
> > 
> > Kindly suggest a way forward ASAP 
>
> From the URL I assume you want to manage AIX systems using Ansible. 
> Also assuming your management station is working correctly. 
>
> What exactly did you try? Do you have an example playbook that doesn't 
> work? 
> Are there any errors that you encounter? 
> Any information at all? 
>
> Dick 
>
>
> > 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/c1c0b1f0-90f3-4f7a-abc4-df16896ee78e%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7dd558db-abf9-44ae-9229-ff655c406581%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Installing Ansible on AIX

2017-03-06 Thread Mona Gopal
Hello,

I need ansible to be installed on AIX 6.1 and 7.1.
Kindly provide the pre-requisites and steps for installation of ansible

Also, would it require any changes to be done in the playbook?

Have been referring to the below link, but hasn't been of much help:
https://www.djouxtech.net/posts/ansible-on-aix/

Kindly suggest a way forward ASAP

Regards,
Mona G


-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c1c0b1f0-90f3-4f7a-abc4-df16896ee78e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ValueError: No closing quotation

2017-02-20 Thread Mona Gopal
Hi,

ansible-playbook -i hosts site.yml - -c paramiko
Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 324, in 
sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-playbook", line 157, in main
inventory = ansible.inventory.Inventory(options.inventory, 
vault_password=vault_pass)
  File "/usr/lib/python2.6/site-packages/ansible/inventory/__init__.py", 
line 128, in __init__
self.parser = InventoryParser(filename=host_list)
  File "/usr/lib/python2.6/site-packages/ansible/inventory/ini.py", line 
43, in __init__
self._parse()
  File "/usr/lib/python2.6/site-packages/ansible/inventory/ini.py", line 
47, in _parse
self._parse_base_groups()
  File "/usr/lib/python2.6/site-packages/ansible/inventory/ini.py", line 
108, in _parse_base_groups
tokens = shlex.split(line)
  File "/usr/lib64/python2.6/shlex.py", line 279, in split
return list(lex)
  File "/usr/lib64/python2.6/shlex.py", line 269, in next
token = self.get_token()
  File "/usr/lib64/python2.6/shlex.py", line 96, in get_token
raw = self.read_token()
  File "/usr/lib64/python2.6/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation

Getting the above error while executing the playbook
Ansible version is: 1.9.4
Python version is: Python 2.6.6

Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/40b030a7-57b6-4fb0-baca-e3de9a6d5b84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Parsing and Comparing a text file

2017-02-07 Thread Mona Gopal
Hello,

My requirement is as below:

A text file with configuration contents would be given to us by the product 
teams.
I will have to compare this file against the one on the remote host , find 
out the difference, and replace values for the variables where it doesn't 
match.
How is this achievable using Ansible.
Kindly suggest a solution.


Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f3d51117-44d8-414c-8bb1-d1a317e6e09d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Need to source .bash_profile on target system

2017-01-10 Thread Mona Gopal
Hi,

Even i am trying to source the bashrc file on my target system.
Ansible runs successfully without errors but doesn't source the file.
Below is my task:

- name: source bashrc file
  shell: source ~/.bashrc
  args:
 executable: /bin/bash

Didn't really find that executable arg helping me out.
Any other way around??
Kindly help.

Thanks in advance
Mona G
On Tuesday, March 24, 2015 at 11:21:59 PM UTC+5:30, bob@evotext.com 
wrote:
>
> Hi,
>
> I'm new to ansible and I'm trying to get ansible to source the 
> .bash_profile of the user on the target system.  We set many environment 
> variables there in order to run a multitude of scripts.  I know that 
> ansible doesn't support this.  Any thoughts on how I can force ansible to 
> source this file?
>
> Thanks!
>
> bob
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c3da2921-8da7-4955-b45e-f23645ee5d97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] MYSQL Connectivity Issue in Ansible

2017-01-04 Thread Mona Gopal


On Wednesday, January 4, 2017 at 3:10:22 PM UTC+5:30, Toshaan Bharvani | 
VanTosh wrote:
>
> On 04/01/17 05:48, Mona Gopal wrote: 
> > Hello, 
> > 
> > I have the below task 
> > 
> > mysql_user: login_user={{ db_user_root }} login_password={{ db_pass_root 
> > }} name={{ db_user }} password={{ db_pass }} priv=*.*:ALL,GRANT 
> > state=present 
> > 
> > 
> > We're facing issue on running this, from machine B to install on machine 
> > A. Installing from machine A to machine B is running fine. 
> > 
> > 
> > However, by specifying login_host parameter this works fine. 
> > 
> > But, the same parameter is not essential while running from A to B. 
> > 
> > What could be the scenario?? why is that login_host parameter is 
> > required when running from B to A and not vice versa. 
>
> I would be guessing, because you do not give enough information. 
> I presume that your server my.cnf bind only to an IP on machine A, while 
> machine B has a UNIX socket connection, the default MySQL python module 
> uses a UNIX socket connection, while you can override that by using the 
> 'login_host' variable and then the module will use a TCP socket 
> Another possibility is that your user running the Ansible task has a 
> .my.cnf in $HOME which overrides the default host value, so you need to 
> specify the correct one manually 
>
> However this is a wild guess, for a better answer, more information is 
> required. 
>
> > 
> > 
> > 
> > Thanks in advance, 
> > 
> > Mona G 
> Regards, 
> Tosh. 
>
>
> Dear Tosh,

Thanks a lot for your response :)
We are checking on the parameters that you mentioned.
Can  you list out what more information is required for a better analysis 
of the same.

Regards,
Mona G 

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2d91a645-bc4a-46af-9b3a-58a21ea6609e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] MYSQL Connectivity Issue in Ansible

2017-01-03 Thread Mona Gopal
Hello,

I have the below task 

mysql_user: login_user={{ db_user_root }} login_password={{ db_pass_root }} 
name={{ db_user }} password={{ db_pass }} priv=*.*:ALL,GRANT state=present


We're facing issue on running this, from machine B to install on machine A. 
Installing from machine A to machine B is running fine.


However, by specifying login_host parameter this works fine.

But, the same parameter is not essential while running from A to B.

What could be the scenario?? why is that login_host parameter is required 
when running from B to A and not vice versa.



Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/67a24fd1-d8ec-4079-890d-f070cfa0bbbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to grant privileges using mysql_user module

2016-11-02 Thread Mona Gopal
Hi,

I am trying to create a mysql user 'webaxnuser' and grant privileges to it.
Below is the task to do the same.

*- name: create use with all priv*
*  mysql_user: login_user=root login_password=pass login_host=188.16.2.3 
host=% name=webaxnuser password=Webaxn@123 priv=*.*:ALL state=present*

The user webaxnuser is getting created, however, the *priv* doesn't work.
Get the below error:

failed: [188.16.2.3] => {"failed": true}
msg: (1045, "Access denied for user 'root'@'%' (using password: YES)")

FATAL: all hosts have already failed -- aborting

How do i go about this issue, 
Kindly suggest a way forward.

Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3e6a3095-8dde-413e-9c5e-adffb512348c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using ansbile and ansbile-playbook with just the password for the remote host

2016-10-19 Thread Mona Gopal
Hi Kai,

I have installed openssh-server and openssh-clients  on the control machine 
using yum.
And still getting the error:  | FAILED => to use the 'ssh' connection type 
with passwords, you must install the sshpass program 


Regards,
Mona G

On Friday, October 7, 2016 at 5:36:45 PM UTC+5:30, Kai Stian Olstad wrote:
>
> On 07.10.2016 12:21, Mona Gopal wrote: 
> > On Monday, October 3, 2016 at 4:10:07 PM UTC+5:30, Kai Stian Olstad 
> > wrote: 
> >> 
> >> On 03.10.2016 12:28, Mona Gopal wrote: 
> >> > I am facing a similar issue. 
> >> > I have non-root access to a server to which i am able to connect 
> >> > manually. 
> >> > But ansible throws "to use the 'ssh' connection type with passwords, 
> >> > you 
> >> > must install the sshpass program" error when i execute the playbook. 
> >> > My hosts file contains the ip address and credentials to login to 
> that 
> >> > server in the below format 
> >> > ip ansible_ssh_user="non-root-user" ansible_ssh_pass="password" 
> >> > 
> >> > Is it necessary to install sshpass on the remote node as well?? 
> >> > I do not have root access, so how do i go about it? 
> >> 
> >> Not on the remote node, but you need sshpass on your Ansible control 
> >> machine. 
> >> 
> > 
> > I have installed openssh-server and openssh-clients on the control 
> > machine 
> > and the error still persists. 
> > Any other way forward?? 
>
> Did you install the package "sshpass" on the control machine? 
> (Non-interactive ssh password authentication). 
> Ansible doesn't require openssh-server on the control machine, but when 
> you are using ssh with password the program "sshpass" is needed on the 
> control machine since ssh doesn’t provide this functionality itself. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4c412afa-ae14-4931-b602-332d517e92fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using ansbile and ansbile-playbook with just the password for the remote host

2016-10-07 Thread Mona Gopal
Hi Kai,

I have installed openssh-server and openssh-clients on the control machine 
and the error still persists.
Any other way forward??


On Monday, October 3, 2016 at 4:10:07 PM UTC+5:30, Kai Stian Olstad wrote:
>
> On 03.10.2016 12:28, Mona Gopal wrote: 
> > I am facing a similar issue. 
> > I have non-root access to a server to which i am able to connect 
> > manually. 
> > But ansible throws "to use the 'ssh' connection type with passwords, 
> > you 
> > must install the sshpass program" error when i execute the playbook. 
> > My hosts file contains the ip address and credentials to login to that 
> > server in the below format 
> > ip ansible_ssh_user="non-root-user" ansible_ssh_pass="password" 
> > 
> > Is it necessary to install sshpass on the remote node as well?? 
> > I do not have root access, so how do i go about it? 
>
> Not on the remote node, but you need sshpass on your Ansible control 
> machine. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/69c89a74-8c54-4575-8186-3bc05fd6fb24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using ansbile and ansbile-playbook with just the password for the remote host

2016-10-03 Thread Mona Gopal
Hi,

I am facing a similar issue.
I have non-root access to a server to which i am able to connect manually.
But ansible throws "to use the 'ssh' connection type with passwords, you 
must install the sshpass program" error when i execute the playbook.
My hosts file contains the ip address and credentials to login to that 
server in the below format
ip ansible_ssh_user="non-root-user" ansible_ssh_pass="password"

Is it necessary to install sshpass on the remote node as well??
I do not have root access, so how do i go about it?

Please suggest ASAP

Thanks in advance,
Mona G


On Saturday, October 12, 2013 at 12:38:55 AM UTC+5:30, Soumya Simanta wrote:
>
> If I do a normal ssh to the machine it works. 
> $ssh myhost 
> user@myhost's password: 
> Last login: Thu Oct 10 13:15:40 2013 from 
>
>
> However when I do any of the following: 
>
> $ansible myhost -m ping -i ansibile_hosts -u myuserid 
> --private-key=~/.ssh/mykey_rsa --ask-pass -
>
> $ansible myhost -m ping -i ansibile_hosts -u myuserid --ask-pass - 
>
> this what I get, I'm using the same password as I used for my ssh login 
> above. 
>
> SSH password: 
>  ESTABLISH CONNECTION FOR USER: myuserid
> x.x.x.x | FAILED => to use the 'ssh' connection type with passwords, you 
> must install the sshpass program
>
> Do I really need sshpass for this work ? I'm on a OS-X (12.5.0 Darwin 
> Kernel Version 12.5.0: Mon Jul 29 16:33:49 PDT 2013; 
> root:xnu-2050.48.11~1/RELEASE_X86_64 x86_64) and looks like it's not easy 
> to install sshpass using port or brew. 
>
> Thanks. 
>
>
>
>
> On Friday, October 11, 2013 2:28:26 PM UTC-4, James Cammarata wrote:
>>
>> Could you please explain how they're not working? Using --ask-pass is the 
>> correct option to have Ansible prompt you for a password. If you're using 
>> SSH as your connection type (or "smart", on a system that is not 
>> RHEL/CentOS 6), you can also add - to get SSH debugging info printed 
>> out.
>>
>>
>> On Fri, Oct 11, 2013 at 9:52 AM, Soumya Simanta  
>> wrote:
>>
>>> I'm new to Ansible.  I know I can add the ssh keys to the remote host(s) 
>>> and that works. But I was wondering if there is a way to do it without 
>>> sharing keys and just putting a password every time the Ansible playbook is 
>>> executed. 
>>>
>>> I tried the following and they don't work. 
>>>
>>> $ansible myhost -m ping -i ansibile_hosts -u myuserid 
>>> --private-key=~/.ssh/mykey_rsa --ask-pass
>>>
>>> $ansible myhost -m ping -i ansibile_hosts -u myuserid --ask-pass
>>>
>>> Thanks. 
>>> -Soumya
>>>
>>> -- 
>>> 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-proje...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> -- 
>>
>> James Cammarata 
>> Sr. Software Engineer, AnsibleWorks, Inc.
>> http://www.ansibleworks.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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c188ecd2-faba-407f-a4d7-4fce698c6763%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Playbook Doesn't run on RHEL 4.x

2016-08-22 Thread Mona Gopal
Hi,

My ansible playbook works on 6.x and the same fails with the below error on 
4.x

Error is:

fatal: [172.19.1.239]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "", "module_stdout": "Traceback (most recent call 
last):\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1471850606.58-237797342898160/setup\", 
line 10, in ?\r\nimport subprocess\r\nImportError: No module named 
subprocess\r\n", "msg": "MODULE FAILURE", "parsed": false}


*4.x has python2.7 installed on it /usr/local/bin.*


Could you please help a way forward


Thanks in advance,

Mona G



-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/85b73d86-657f-443f-984c-df2a56e95675%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Storing Arrays in variable

2016-07-27 Thread Mona Gopal
Dear All,

I have a file with the below content:

## NexGen SS7 maximum allowed configuration file 

MAXIMUM_INSTANCES = 2
MAXIMUM_LINKS = 0
MTP2  = NO
SCTP = YES
M2UA = NO
MTP3 = NO
M3UA = YES
SCCP = YES
TCAP = YES
*MAC = 441ea15e6f44,441ea15e6f46,441ea15e4ff8,441ea15e4ffa*
LIC-START-TIME = 00/00/
LIC-END-TIME = 31/12/

And my requirement is to fetch each of the MAC value and pass it as an 
argument to script module to different hosts *441ea15e6f44, 441ea15e6f46, 
441ea15e4ff8, 441ea15e4ffa *

How do I go about doing it??

Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5b65da05-5dfa-48c7-a405-e96be48c8ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible-Python Dependency

2016-07-27 Thread Mona Gopal
Dear All,

   I have a playbook written to fetch various type of inventory information.
   This playbook gives the following error when i try to run in on RHEL5.5 
 server with Python2.4.3 in it

   Error:
 fatal: [172.19.1.156]: FAILED! => {"changed": false, "failed": true, 
"msg": "Error: ansible requires the stdlib json or simplejson module, 
neither was found!"}

How do I go about resolving it from my control machine itself?

Also,  a basic query: Does ansible need python2.6 on the remote 
machines as well??

Thanks in advance,
Mona G


-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c781dbcd-5d97-4851-b209-ce81aef55426%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible-Python Dependencey

2016-07-27 Thread Mona Gopal
Dear All,

   I have a playbook written to fetch various type of inventory information.
   This playbook gives the following error when i try to run in on a server 
with RHEL5.5 Python2.4.3
   

   

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8c5183d8-417a-4e76-8929-ab35def2a664%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Lineinfile append at EOF

2016-06-13 Thread Mona Gopal
Hi All,

 I figured out that the below works to append to a file,

- name: Write redis details to file
  local_action: lineinfile dest={{ third_party_dest_path }} line=redis 
state=present create=yes

However, i am unable to append the registered variable value to the file

- name: Write redis details to file
  local_action: lineinfile dest={{ third_party_dest_path }} *line="{{ redis 
}}"* state=present create=yes




On Tuesday, June 14, 2016 at 10:36:33 AM UTC+5:30, Mona Gopal wrote:
>
> Hi all,
>
> I am trying to use the lineinfile module to append  some of the software 
> details to a file. 
> I don't want to match to any regexp, but just insert every software 
> details at the EOF.
>
>
> Below is the piece of code.
>
> - name: Collect python details
>   action: get_python_details 
>   register: python
>
> - name: Write registered variable to file
>   local_action: lineinfile dest={{ third_party_dest_path }}  line={{ 
> python }} regexp="" insertafter=EOF state=present create=yes
>
> Have also tried giving regexp="^$", regexp="^\s*$" as well to match to an 
> empty line, but throws the below error.
>
> Error:
>
> An exception occurred during task execution. The full traceback is:
> Traceback (most recent call last):
>   File 
> "/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", 
> line 2540, in 
> main()
>   File 
> "/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", 
> line 371, in main
> ins_aft, ins_bef, create, backup, backrefs)
>   File 
> "/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", 
> line 266, in present
> lines.append(line + os.linesep)
> TypeError: unsupported operand type(s) for +: 'dict' and 'str'
>
> fatal: [172.19.3.60 -> localhost]: FAILED! => {"changed": false, "failed": 
> true, "invocation": {"module_name": "lineinfile"}, "parsed": false}
>
>
> Kindly help on how to go about appending to EOF without matching to any 
> regexp.
>
>
> Thanks in advance,
>
> Mona G
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/979288ed-eb60-4d20-8f6c-9dd415ce7ef4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Lineinfile append at EOF

2016-06-13 Thread Mona Gopal
Hi all,

I am trying to use the lineinfile module to append  some of the software 
details to a file. 
I don't want to match to any regexp, but just insert every software details 
at the EOF.


Below is the piece of code.

- name: Collect python details
  action: get_python_details 
  register: python

- name: Write registered variable to file
  local_action: lineinfile dest={{ third_party_dest_path }}  line={{ python 
}} regexp="" insertafter=EOF state=present create=yes

Have also tried giving regexp="^$", regexp="^\s*$" as well to match to an 
empty line, but throws the below error.

Error:

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File 
"/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", line 
2540, in 
main()
  File 
"/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", line 
371, in main
ins_aft, ins_bef, create, backup, backrefs)
  File 
"/root/.ansible/tmp/ansible-tmp-1465888759.41-82910653497853/lineinfile", line 
266, in present
lines.append(line + os.linesep)
TypeError: unsupported operand type(s) for +: 'dict' and 'str'

fatal: [172.19.3.60 -> localhost]: FAILED! => {"changed": false, "failed": 
true, "invocation": {"module_name": "lineinfile"}, "parsed": false}


Kindly help on how to go about appending to EOF without matching to any regexp.


Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e41e4b99-4754-41de-832a-e618fb943e67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to change user for play

2016-06-09 Thread Mona Gopal
Hi,

Oam.yml

 

- name: apply common configuration to all nodes

  hosts: all

# user: root

  become: yes

  become_user: sudo

  become_method: sudo

  vars_files:

 - dependency_list.yml

 - client_dependency_list.yml

 

  roles:

 - { role: server, when: server_or_client_installation|int == 1, tags: 
server, when: ansible_os_family == "RedHat" and 
ansible_distribution_major_version|int >= 6}

 - { role: client, when: server_or_client_installation|int == 2, tags: 
client, when: ansible_os_family == "RedHat" and 
ansible_distribution_major_version|int >= 6}

 

Hosts 

 

172.19.4.64 ansible_ssh_user="root"



Query:

Want to sudo on the server where i am running this playbook and it sudo 
does not require a password.

the above play throws authentication failure error

Please help.



Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c668c7f1-c777-4f77-beee-add7410ac15f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using make to install

2016-05-24 Thread Mona Gopal
 

Hello,


I am trying to install perl module for nagiosgraph-1.5.2  with ansible 

which can be installed manually with three steps 
1> perl Makefile.PL 
2> gmake 
3> gmake install


afetr 3> gmake install nagiosgraph asking to confirm path where its getting 
installed. manually we keep pressing enter and finally its installed 

 

Destination directory (prefix)? [/usr/local/nagiosgraph]

Location of configuration files (etc-dir)? [/usr/local/nagiosgraph/etc]

Location of executables? [/usr/local/nagiosgraph/bin]

 

But in ansible it is getting stuck in 3rd step as its waiting for the 
inputs , how should this be handled?

 

Ansible task is as below:

- name: Install nagiosgraph-1.4.4.tar.gz after untar

  shell: "{{ item }}"

  with_items:

- perl Makefile.PL

- gmake

- gmake install

 

  args:

  chdir: 
/tmp/{{build_name}}/{{binary}}/RHEL6_64Bit-Install/{{dependencies}}/nagiosgraph-1.4.4/



Thanks in advance,

Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/79d71070-dc05-4071-bc41-a865f163b628%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible_facts access within a custom module

2016-05-17 Thread Mona Gopal
Hi,


import exceptions
import subprocess
from ansible.module_utils.basic import *


def main():
module = AnsibleModule(argument_spec = dict(data=dict(required=False, 
default=None),),supports_check_mode = True)
dt = {"System_Details":{'Kernel_version':ansible_hostname}}
module.exit_json(ansible_facts=dt)
main()

Above is my custom module, where i am trying to access the ansible facts. 
I am getting the below error:

fatal: [172.19.3.60]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "", "module_stdout": "Traceback (most recent call 
last):\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1463490863.86-275822236207074/get_system_specific_details\",
 
line 2014, in \r\nmain()\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1463490863.86-275822236207074/get_system_specific_details\",
 
line 2011, in main\r\ndt = 
{\"System_Details\":{'Kernel_version':ansible_hostname}}\r\nNameError: 
global name 'ansible_hostname' is not defined\r\n", "msg": "MODULE 
FAILURE", "parsed": false}


Can you please help me out??

Thanks in advance,
Mona G
=

On Thursday, May 15, 2014 at 4:02:05 PM UTC+5:30, Christian Huck wrote:

> Hi,
>
> how can I access the ansible_facts within a custom module which was 
> initialized with the AnsibleModule class ?
>
> I either:
>
> a) need to pass the facts as a module parameter
>
> or
>
> b) access the facts directly inside the module
>
> Thanks in advance.
>
> Christian
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f2dea361-3563-4b46-b7a5-8151324a9631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible_facts

2016-05-17 Thread Mona Gopal
Hi,

I am writing an inventory playbook to  fetch the system information such as 
CPU details, Network Related info, Disk space related info and system 
specific information.
Ansible already provides some of these info that i need in the setup module.
I want to customize it or rather fetch specific category of information 
from this setup module and write it to a template in json format.


I have done this using the custom module for fetching the third party 
information and fetched the information in the below format
{
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'logstash_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'mongod_version': u'NOT_INSTALLED'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'redis_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'nginx_version': u' nginx/1.8.0'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'nodejs_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'django_version': u'1.6'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'php_version': u'PHP 5.1.6 (cli)'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'httpd_version': u'NOT_INSTALLED'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'python_version': u'Python 2.7.3'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'psql_version': u'psql (PostgreSQL) 8.1.18'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'mysql_v': u'mysql Ver 14.12'}}},
}
How could I do the same with my available facts?


Thanks in advance,
Mona G



-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/39f1a2ed-8774-4354-b0b8-b6228934a539%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Passing parameters to custom module

2016-04-26 Thread Mona Gopal
Hi,

I have written custom modules in python.
I am calling the modules from my task file like below:

- name: Collect logstash details
  action: get_logstash_details  *path*={{ logstash_path }}
  register: result
- name: Display the logstash details
  debug: var=result


get_logstash_details is my custom module.
path is the parameter i want to pass to the custom module.

This paramter is accessed in custom module as mentioned below
path=sys.argv[1]


Queries:
1) Is that the right way to send parameters to custom module?

I am getting the below error:
fatal: [172.19.10.31]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_args": {"path": 
"/opt/logstash_standalone/logstash-2.1.1/bin/logstash"}, "module_name": 
"get_logstash_details"}, "msg": "unsupported parameter for module: path"}


Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/956117c2-a4e0-48c9-a58a-96ed9ae41c80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Privilege Escalation

2015-07-19 Thread Mona Gopal
I'm currently using ansible 1.9.2

On Sunday, July 19, 2015 at 1:47:09 AM UTC+5:30, Brian Coca wrote:
>
> What version of ansible? 
>
> I just removed this in 2.0 as I thought it was an oversite (i cringed 
> at passwords embedded in playbooks), but I will reconsider if a good 
> case can be made for the feature. 
>
>
> -- 
> 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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08cd2331-0fea-4afa-9075-da157829d5ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Privilege Escalation

2015-07-15 Thread Mona Gopal

   Hello Everyone,
   
Below is a  play that i have written to execute the task as a sudo user.

  - name: Testing the sudo user concept in this play
hosts: all
#  user: ved 
   become: yes
   become_method: su
   become_pass: root_123

  tasks:
- name: edits the contents of the file this task will execute only as a 
root user
  lineinfile: dest=/root/sample.txt  state=present insertafter='EOF' 
line='GAURAV' regexp='MONA'
#become: yes
#become_method: su
#become_pass: root_123


The problem : 
   
   The "become_pass"  does not work in case of a play , but works fine in 
case of a task. 
   Could anyone help me out with this?
   Our task is to run the playbook on click of a button in GUI ,so we 
cannot go by the method of prompting for password.
   And also to mention we have multiple tasks to be executed and hence want 
to apply the become_pass for a play and just a task(like i mentioned in 
case of a task it works fine.)

Thanks in advance,
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9c71ca9d-69cf-45e2-aa46-26fe87a3b514%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Progress bar indication while executing a task

2015-02-16 Thread Mona Gopal
Hi,

Is there any way to indicate the progress while executing a task ??

For eg:

I've written a task to copy the build on to the remote server,
This copy would take more time due to the build size, having a progress bar 
will help us to know the progress state of the task.

If there is any way please help me out.

Regards, 
Mona G

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/37d053af-66ca-4ae9-9170-2bfaac8b270c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.