[ansible-project] Re: bash script not writing to file with ansible, but does locally

2016-09-16 Thread richard kappler
is being > promptly deleted as soon as the task finished. Try adding a > chdir=/some/permanent/path to the end of the command task to run the script > from a non-ephemeral location. > > On Thursday, September 15, 2016 at 12:30:28 PM UTC-7, richard kappler > wrote: >> >&

[ansible-project] bash script not writing to file with ansible, but does locally

2016-09-15 Thread richard kappler
I have a bash script ( I know, it's a bit sloppy): #!/bin/sh df -h >> mongo-rebuild-validate.log 2>&1 /opt/mongodb/bin/mongo localhost:27017 /opt/mongodb/mongodb-create-visionnode.js >> mongo-rebuild-validate.log 2>&1 /opt/mongodb/bin/mongoimport --host 127.0.0.1 --db visionnode --collection

Re: [ansible-project] Variable declared in inventory not what is put in file - sometimes

2016-08-25 Thread richard kappler
where 0456 was oct, and 302 is the int > value. > > On Thu, Aug 25, 2016 at 2:35 PM, richard kappler <richk...@gmail.com > > wrote: > >> I have run a playbook that updates an app of ours on numerous customer >> VM's. This playbook has run fine many times, but tod

[ansible-project] Variable declared in inventory not what is put in file - sometimes

2016-08-25 Thread richard kappler
I have run a playbook that updates an app of ours on numerous customer VM's. This playbook has run fine many times, but today when I ran it to update 6 servers, one of my variables was not properly put into the target files on 4 of the 6 VM's. More specifically, this variable is a four digit

[ansible-project] Script runs but ansible fails?

2016-04-13 Thread richard kappler
This is a continuation of an earlier thread "Can Ansible interact with an Application." If Edgars is reading, I went a little different route. Parted won't quite work as I'm adding two partitions to /dev/sda which already has boot, swap and root on it and is mounted. I did some research, and

[ansible-project] Re: Can Ansible interact with an application?

2016-04-13 Thread richard kappler
6384 100% set 1 lvm on > > Or, there is expect module, but I don't recommend it in this case. > > Edgars > > > trešdiena, 2016. gada 13. aprīlis 15:16:59 UTC+2, richard kappler rakstīja: >> >> I am writing a playbook to set up new VM's remotely, and two of

[ansible-project] Can Ansible interact with an application?

2016-04-13 Thread richard kappler
I am writing a playbook to set up new VM's remotely, and two of the tasks require interaction with a utility and an app, and I'm presuming this could be done in Ansible, but have no idea how, so I'm looking for a pointer to the appropriate tutorial, or confirmation that Ansible can't do it.

Re: [ansible-project] Re: selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
Brilliant, I think that gives me everything I need other than to dive deeper into selinux contexts, thanks Brian, regards, Richard On Monday, February 29, 2016 at 4:07:21 PM UTC-5, Brian Coca wrote: > > So the current yum module can install from an rpm, even if you cannot use > the copy module

[ansible-project] Re: selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
Thanks to Brian for the reply, it begs a couple more questions, but first let me state my 'new understandings' based on some sleuthing I did through our testenv logs and ansible core modules code while trying to figure this out. It looks to me like when you first use ansible a .ansible dir is

Re: [ansible-project] selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
I see now that I forgot to add the important comment that these machines do not have internet access. Hence I would need to copy the selinux-python rpm to the target machines, which it would seem that I cannot do until I have that rpm installed. Or am I missing something? I could just scp the

[ansible-project] selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
We will be making changes to nearly a hundred client machines using ansible. We've used ansible before, albeit we're still pretty new at it, but have a pretty good handle on it and have done before what we want to do now, which is edit a config file. The new target machines have selinux

[ansible-project] playbook executes but hangs when executing remote python script

2015-12-21 Thread richard kappler
I need to stop and then start a python script on numerous remote servers. I set up a vm in our test environment to walk through this. The 'remote server' has a simple python script (test.py) in /test directory: #!/usr/bin/env python while True: print "running\n" my playbook has a hosts

[ansible-project] # of ssh connections / timeout function?

2015-12-02 Thread richard kappler
This is a two part question. I sort of worked around the problem I asked about yesterday (third task crashes on third of 4 machines) by splitting up my playbook into 3 parts. Ugly, but for now it works, at least on four machines at a time, testing bigger inventory now. *Possibly pertinent

[ansible-project] Re: {{ inventory_hostname }} variable

2015-12-01 Thread richard kappler
no, indeed it worked as I had hoped, and as Roger and Brian spoke of. By using [servers] name ansible_ssh_host=xx.xx.xx.xx it worked just fine. Ran into some other problems, but that's a different post regards, Richard On Wednesday, November 25, 2015 at 11:45:25 AM UTC-5, richard kappler

[ansible-project] 3rd machine fails on moving a tar file...every time, not the same machine

2015-12-01 Thread richard kappler
Good day. We're new to Ansible so we might be missing something obvious. We have a playbook that deploys a splunk forwarder to remote machines: --- - name: deploy splunk forwarder to servers hosts: servers tasks: - name: mkdir /home/engineering/TEAM file: path=/home/engineering/TEAM

[ansible-project] {{ inventory_hostname }} variable

2015-11-25 Thread richard kappler
New to Ansible here, and have a question on using an inventory_hostname variable. I have a playbook that deploys an add-on to numerous servers, using an inventory list of IP addresses setup as so: [servers01] xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy [servers02] zzz.zzz.zzz.zzz and so on. One of the

[ansible-project] provide app username and password

2015-06-11 Thread richard kappler
How would I provide a username and password for an application? Specifically, within a running app to which I am deploying and add-on I need to run a script to verify proper operation of the add-on installation. When the command to run the script is entered, the app asks for a username and

[ansible-project] Re: provide app username and password

2015-06-11 Thread richard kappler
I figured it out. - - user: name=name password=password - command: do something On Thursday, June 11, 2015 at 10:31:54 AM UTC-4, richard kappler wrote: How would I provide a username and password for an application? Specifically, within a running app to which I am deploying and add-on I

Re: [ansible-project] delete a remote file

2015-06-09 Thread richard kappler
Brilliant, thanks! On Monday, June 8, 2015 at 12:59:00 PM UTC-4, Brian Coca wrote: Your file command is the correct one to use, just note that path=~/filename will depend on the remote user. try using the full path when in doubt. On Mon, Jun 8, 2015 at 12:11 PM, richard kappler richk

[ansible-project] Vars from hosts?

2015-06-09 Thread richard kappler
Not sure the best way to do this, have read the documentation but still a wee bit befuddled. We're ramping up to be able to deploy to several hundred servers. Each server will have an assigned name. Some of the files that will be deployed will need that name, whereas as deployed they have a

Re: [ansible-project] Vars from hosts?

2015-06-09 Thread richard kappler
Actually, I'm reading Ansible: Up and Running, and under inventory_hostname it says I did it right, yet when I ran the playbook, I got an error saying inventory_hostname wasn't defined. I think maybe I should start a new thread. On Tuesday, June 9, 2015 at 2:42:53 PM UTC-4, richard kappler

[ansible-project] inventory_hostname

2015-06-09 Thread richard kappler
trying to replace a word in file. I have a testfile1.conf: --- this is a test file this server name is placeholder --- I have an inventory file (and a hosts file, still trying to figure those out): [servers]

Re: [ansible-project] Vars from hosts?

2015-06-09 Thread richard kappler
I see what you're saying. Tried to put it into play, but I'm obviously still missing some fundamental knowledge. How do I call the variable? I tried: - replace: dest=filename regexp='placeholder' replace={{ inventory_hostname }} backup =no and it wouldn't work. I can get the

Re: [ansible-project] Vars from hosts?

2015-06-09 Thread richard kappler
2015 11:48 -0700, richard kappler richkapp...@gmail.com wrote: Actually, I'm reading Ansible: Up and Running, and under inventory_hostname it says I did it right, yet when I ran the playbook, I got an error saying inventory_hostname wasn't defined. I think maybe I should start a new thread

[ansible-project] delete a remote file

2015-06-08 Thread richard kappler
What is the proper way to delete a remote file. Example: If I've used Ansible to copy a file to a remote server, how do I delete it from ansible? I've looked in the docs, googled it, tried using the shell command with rm, also with src=filename removes=True; I've tried the same in command, I've