[ansible-project] ansible template vars for command line invocation

2021-08-11 Thread Ed Greenberg
Hi, I have a bash command of: ansible beta -m template -a 'src=../templates/www.conf.j2 dest=/root/www.conf ' I need to specify a variable on the command line. I tried specifying it in the -a string, but got an error that template only accepts certain variables. IF the template was in a pla

[ansible-project] mysql_user does not find /root/.my.cnf

2020-09-16 Thread Ed Greenberg
he .my.cnf needed to be. Since I log in as root, I figure it's /root/.my.cnf. My /root/.my.cnf is: [mysql] user=root password=xxx [mysqldump] user=databasebackup password=xxx Do I need another section, perhaps? What else might be wrong? Thanks, Ed Greenberg -- You rece

[ansible-project] Trouble with quoting variables

2020-07-02 Thread Ed Greenberg
uot; I've tried quoting the entire thing with both single quotes and then with double quotes, escaping the embedded quotes with backslashes. I've tried putting quotes in jinja curlies. such as {{ '"' }} . Just about every permutation I can think of. Is this even pos

[ansible-project] best way to test for a condition and report it

2019-08-13 Thread Ed Greenberg
Hi, I have an ansible module that adds and removes servers from the load balancer. If I do: ansible localhost -m modulename -a 'servername=foo inbalancer=present' it adds the module to the load balancer and reports changed if it wasn't there before, and not changed if it was already there.

[ansible-project] How to run a playbook or command against AWS

2019-02-04 Thread Ed Greenberg
t I don't understand is how to run the playbook. I tried: ansible-playbook secgroup.yml -e'cidr=xxx.xxx.xxx.xxx/32 rule_desc=web7 but the playbook timed out since the above endpoint doesn't answer ssh. So how do I specify what IP/Proto ansible is to use to connect? Many than

[ansible-project] Re: Ansible syslogs to user.notice on the managed machine - can I change this?

2017-07-12 Thread Ed Greenberg
This is how I solved the problem in rsyslog.conf: if $pri-text == 'user.notice' and $msg contains 'ansible' then { /var/log/ansible.log stop } I put this pretty close to the top of the rsyslog.conf, above GLOBAL DIRECTIVES. -- You received this message because you are subscribed to t

[ansible-project] Ansible syslogs to user.notice on the managed machine - can I change this?

2017-07-11 Thread Ed Greenberg
I have a task logging to user.notice, and I can't change it. Ansible also logs to user.notice, and I'm wondering if I can change where it does that on a global basis. One of the locals would be nice. Any way to do this? Ed Greenberg -- You received this message because you are

[ansible-project] Test for empty dict

2017-06-08 Thread Ed Greenberg
I have this: TASK [debug] *** ok: [localhost] => { "changed": false, "msg": { "changed": false, "volume": {} } } I'd like to test for this condition, where volume is an empty dict. I tried when volu

[ansible-project] using rax_cbs to test a volume

2017-06-05 Thread Ed Greenberg
Hi, Folks, I'd like to be able to test for a volume by name before trying to create it. If the name exists, the playbook needs to fail, so that it can be called with a new name. Nothing was obvious in the documentation for rax_cbs. Anything I try seems to create a volume. I left out state= an

[ansible-project] DNSMADEEASY question ATTN Brice Burgess

2017-05-10 Thread Ed Greenberg
rd is failing because it does not have a record_type. So adding the record_type (which is TXT by the way) I get a success, but the module created a second TXT record with the same name, which makes sense after reading the code. What I don't see is how a record ever gets updated (or deleted

[ansible-project] dnsmadeeasy question

2017-05-09 Thread Ed Greenberg
Now, I know what it looks like, and what it looked like before, but I don't know how to call the dnsmadeeasy module to put it back. What seems to be needed is a "update record by id" function. Any suggestions? Thanks, Ed Greenberg -- You received this message because you are s

[ansible-project] make module not idempotent

2017-05-03 Thread Ed Greenberg
For certain values of idempotent :) I notice that the make module shows changed every time. I'm trying to make mod_security: - name: make modsecurity make: chdir: /root/modsecurity-2.9.1 every time this runs, it shows changed. Nothing in the docs indicates that there is a way t

[ansible-project] Crons on a collection of servers

2017-03-08 Thread Ed Greenberg
We have a collection of load balanced web servers, and we have cron jobs spread across the server base. I would like to manage these cron jobs in Ansible. The current state is to have all the cron jobs on all the servers, disabled, and then to selectively enable the ones that need to run on

[ansible-project] variable for server as entered in inventory

2015-12-21 Thread Ed Greenberg
but didn't find anything that was a simple as what I'm looking for. Can somebody point me appropriately? Thanks, Ed Greenberg -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop rec

[ansible-project] quoting a colon - I can't get it right

2015-07-10 Thread Ed Greenberg
Can somebody help me get this to work? The colon following NOPASSWD is causing me fits. - name: add permission for nrpe to access vzlicview action: lineinfile dest=/etc/sudoers regexp=^nrpe line="nrpe ALL=(ALL) NOPASSWD: /usr/sbin/vzlicview" state=present I've tried a bunch of perm

[ansible-project] Re: Writing ansible module in shell/bash script

2015-03-03 Thread Ed Greenberg
I fixed this with: echo -n '{"changed": "true"}' Note that the quotes around "changed" and "true" were essential. Thanks all -- 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 i

[ansible-project] Re: Writing ansible module in shell/bash script

2015-02-13 Thread Ed Greenberg
r\n", "parsed": false } This module, rescued from an old (pre 1.0) installation of ansible, used to succeed, so I wonder, what changed, or what I might have done wrong. This is Ansible 1.8.2-1.el6 from the epel repo, running on centos 6.5. Any help welcome. Thanks, Ed Gr