Re: [ansible-project] Get "Could not find the requested service" when trying to restart httpd; but it is installed

2018-11-16 Thread Dick Davies
Could not find the requested service ['httpd']: host"} looks to me like your issue is in the playbook., You're passing an array ( 'services' ) in as the service name, ansible is treating that as a length 1 array rather than just a string. Replace the "{{ services }}" with just : httpd and I bet

Re: [ansible-project] how to use systemd to start my custom service

2018-11-16 Thread Dick Davies
"msg": "Failed to get D-Bus connection: Operation not permitted", you're not running ansible with high enough privileges. try a become: yes somewhere in there. On Thu, 15 Nov 2018 at 02:47, Ronnie10 wrote: > > Hi all, > > I am trying to setup zookeeper using ansible with docker, I have copied

Re: [ansible-project] Set AWS Hostname

2017-11-16 Thread Dick Davies
You have a YAML nesting mistake - Ansible is reading your register: as a property of the task, rather than at the same level as the task. Your 'with_items:' on the next task has the same issue. On 16 November 2017 at 09:33, Byym Reddy wrote: > I'm using ansible to create aws

Re: [ansible-project] Ansible service module

2017-11-13 Thread Dick Davies
Look at the wait_for module, it should be able to help you if you need to, uh, wait for a specific state. On 13 November 2017 at 07:27, Harish Singh <08harishsi...@gmail.com> wrote: > Hey !! > > If I am working with ansible service module, if in case my tomcat take time > more then min. Or 2

Re: [ansible-project] Ansible playbook xml module - error when using in task

2017-10-02 Thread Dick Davies
If you just create a library/ folder and put the xml module in there, it'll work. We've been using the xml module since 2.0 this way, it works fine. On 2 October 2017 at 16:04, Sivakumar Lakshminarayanan wrote: > Sorry missed to see that, my bad. > Bad luck in our

Re: [ansible-project] yum module localinstall many rpms from directory possible?

2017-09-21 Thread Dick Davies
That's fine, look at with_items to get it all done in a single yum transaction. On 21 September 2017 at 19:51, daddyocruzer wrote: > Hello > > tasks: > - name: yum local install > yum: name=/sharedfilesystem/*.rpm state=present > > Our team has several

Re: [ansible-project] Where to put environnement specific config files to copy (not templated)

2017-09-13 Thread Dick Davies
What about something like: copy: src: "{{ env }}/config/httpd.conf" dest: /etc/httpd/httpd.conf and then just set env: production in production/group_vars/all ? (there are a few ways to calculate the 'env' var based on inventory etc. but they're a bit arcane IMO. Better to be explicit.)

Re: [ansible-project] Running tasks in parallel in a playbook

2017-09-08 Thread Dick Davies
http://docs.ansible.com/ansible/latest/playbooks_loops.html#looping-over-a-list-with-an-index On 7 September 2017 at 19:14, Giovanni Gaglione wrote: > I basically need the index of the current hostname, but I can't find a way. > {{

Re: [ansible-project] Best practice for cluster nodes

2017-09-08 Thread Dick Davies
Have you seen the serial: argument to plays? http://docs.ansible.com/ansible/latest/playbooks_delegation.html#rolling-update-batch-size That's intended for working on a 'chunk' of N servers in a given group at once. On 6 September 2017 at 13:00, Cev Ing wrote: > I have

Re: [ansible-project] Need to chat off-forum

2017-08-29 Thread Dick Davies
This is currently an opinion argument, and you need to turn it into a numbers argument. It's the only way to get past egos. If a team deliver what they're asked to do on spec and on time, I personally don't care what tooling they use, whether it's ansible or hand-crafted. If they're delivering

Re: [ansible-project] Ansible Inventory

2017-08-27 Thread Dick Davies
You want group vars (unless your windows and linux hosts are in the same group, but unless you're applying the same roles to both you probably don't have that.). http://docs.ansible.com/ansible/latest/intro_inventory.html#splitting-out-host-and-group-specific-data On 27 August 2017 at 17:08,

Re: [ansible-project] My first steps: apt module

2017-07-24 Thread Dick Davies
Old version? http://docs.ansible.com/ansible/latest/apt_module.html says: "autoremove (added in 2.1)" On 24 July 2017 at 12:48, Peter Kaagman wrote: > Hi there group, > > I'm making my first baby steps with ansible. After fooling around with > ad-hoc command I thought

Re: [ansible-project] Using Pathword Authentication to run a Playbook

2017-07-22 Thread Dick Davies
What about not putting the users keys onto the production servers? On 21 July 2017 at 17:21, JS wrote: > Hello! > > I have a single playbook that with various plays in it. > > It goes out to different environments, either dev, uat, or prod (based on > the --extra-vars

Re: [ansible-project] /etc not writable

2017-07-22 Thread Dick Davies
Nope, that's super bad. I thought you didn't have root access? On 22 July 2017 at 13:06, Yuriy Buha wrote: > Hi Fayad. > > Thank you for the quick reply. > I tried to create the file in user's home directory, and then move to the > /etc, but then i would get a permission

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-14 Thread Dick Davies
sudo ansible-playbook . will work but then you're running the whole play as local root, which feels wrong. I can't think why you'd want to do that, if you aren't making changes to that host. In this example you're shipping public keys, there's no downside to having them locally (or better

Re: [ansible-project] Playbook gives inconsistent results

2017-07-14 Thread Dick Davies
There's no way to figure out what's happening from just that description, did you provide a test case on github? On 14 July 2017 at 14:07, MKPhil wrote: > I've got a multi-task playbook - if I run it against Servers A & B, all > tasks run for both servers. If I run it

Re: [ansible-project] Host: command output differs on localhost and FQDN

2017-07-14 Thread Dick Davies
It'll be a path thing most likely. It's in your path on localhost, and not on the account you're using remotely. On 13 July 2017 at 22:05, Listing wrote: > Hi, > > I am trying to run the following playbook: > > --- > - hosts: mymachine.lan > become: true > tasks: > -

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-12 Thread Dick Davies
Copy the public keys into the playbook directory. On 12 July 2017 at 19:11, Anfield wrote: > How would I get around this issue on the localhost? I tried adding > become_user: root and that didnt work either > >> > -- You received this message because you are subscribed

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-08 Thread Dick Davies
It's this part: - name: Copy ths ssh public key into the authorized key dir on the remote host copy src: "/home/{{item}}/.ssh/id_rsa.pub" are the public keys at those paths on the Ansible host? On 8 July 2017 at 19:18, Anfield wrote: > > I have the below

Re: [ansible-project] Add role dependency to another role without it being executed automatically

2017-07-07 Thread Dick Davies
It doesn't sound like you want a dependency at all. Why not just stick the slack tasks in the relevant roles? You're losing a lot of clarity trying to use a role to save a bit of typing, and from the look of that gist you aren't even saving much typing :) On 7 July 2017 at 20:08, Lee Connell

Re: [ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread Dick Davies
component) - for > better readability without being forced to run the playbook several times? > > On Thursday, July 6, 2017 at 8:50:27 AM UTC+2, Dick Davies wrote: >> >> Try setting up one inventory for QA, another for DEV, and a third for >> production. >> Y

Re: [ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread Dick Davies
Try setting up one inventory for QA, another for DEV, and a third for production. You can use the same playbooks with different inventories so it'll keep the environments isolated but you'll get better consistency between each env. On 6 July 2017 at 07:36, wrote: >

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
now where to start, > Should i save the keys in some file and refer that fiile in the playbook as > a variable? > > On Tuesday, July 4, 2017 at 3:53:38 PM UTC+5:30, Dick Davies wrote: >> >> Sorry I thought you wanted to know about file lookups (in this case >> it's ssh ke

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
Sorry I thought you wanted to know about file lookups (in this case it's ssh keys). If the -e 'credentials=/path/to/credentials' , you just need to lookup the file and read it's contents. Or just set environment variables before you run the playbook, I thought the aws related modules read the

Re: [ansible-project] Re: starting karaf with ansble

2017-07-04 Thread Dick Davies
Is this an init script? It sounds like it relies on something in the environment. Does it start at boot cleanly? If not, that's almost certainly the issue, you might find setting some variables explicitly in the init script sorts things out. On 4 July 2017 at 08:31, fanvalt

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
Yes, you can use lookups, like this - name: set authorized_keys authorized_key: user={{ item }} exclusive=yes key="{{ lookup('file', 'files/pubkeys/{{ item }}.key') }}" with_items: "{{ team_members[team] }}" team_members[team] here is a list of usernames, the files live in

Re: [ansible-project] get_url runs but doesnt download the file

2017-07-03 Thread Dick Davies
Explain what you're expecting, because this indicates the file is already downloaded and the checksum matches. I might be reading it wrong, or have the wrong end of the stick...? On 3 July 2017 at 17:31, Anfield wrote: > ok: [10.10.0.5] => { > "changed": false, >

Re: [ansible-project] Permissions issue, cannot become root

2017-06-28 Thread Dick Davies
become_user is the user you sudo to, that should probably not be the same as remote_user (or it's a bit of a waste of time). On 27 June 2017 at 17:44, lask001 wrote: > Been banging my head against this since yesterday, hoping someone is able to > shed some insight on my

Re: [ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread Dick Davies
t. > > I'm trying to talk my team into using Ansible over Puppet because it, > initially, seemed a lot easier to get started with. Now that I'm digging > deep into this, though, Puppet is much easier when it comes to managing > hierarchical data (via hiera). > > On Wednesda

Re: [ansible-project] include uid with ansible entries in messages log

2017-06-21 Thread Dick Davies
null 2>&1 ==> /var/log/messages <== Jun 21 19:18:57 jira1 ansible-service: Invoked with name=mysqld pattern=None enabled=True state=started sleep=None arguments= runlevel=default Shame its not in one log, but it does tick the audit box for privilege escalation... On 21 Ju

Re: [ansible-project] include uid with ansible entries in messages log

2017-06-21 Thread Dick Davies
Sudoing to run Ansible on the control machine won't show up in the target server logs. If ansible sudos on the targets (i.e. you have become: yes in the plays) that should show up. On 21 June 2017 at 15:56, Steve Zimmerman wrote: > Hello, > I have an audit/security

Re: [ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread Dick Davies
I played around with 'flat file' variables and a dynamic inventory a while back; group variables seemed to override the inventory level ones. YMMV, check the precedence levels for vars for the version of Ansible you're running. On 20 June 2017 at 22:39, William Saxton wrote: >

Re: [ansible-project] Securing ansible - best practice?

2017-06-21 Thread Dick Davies
There's a few options. You can do a 'pre-seed' ssh key (added via Kickstart on in the VMware template; on AWS you'd add this as the instance is created). Ansible can use that to get in initially once the server is up and create more users/groups as desired. Another option would be a central key

Re: [ansible-project] How can load an inventory file via a task within a playbook

2017-06-21 Thread Dick Davies
gt; > On Tuesday, 20 June 2017 17:24:37 UTC+2, Dick Davies wrote: >> >> Can't you just pull the git repo before you run the inventory? >> >> >> On 20 June 2017 at 15:00, ishan jain <ishan...@gmail.com> wrote: >> > I keep my inventory files for each en

Re: [ansible-project] How can load an inventory file via a task within a playbook

2017-06-20 Thread Dick Davies
Can't you just pull the git repo before you run the inventory? On 20 June 2017 at 15:00, ishan jain wrote: > I keep my inventory files for each environment in GIT repositories. I am > working on some sort of a helper service which i am writing in Ansible and > this should

Re: [ansible-project] How can I detect Atomic version of CentOS with Ansible facts (setup) mechanism?

2017-06-19 Thread Dick Davies
Start with: how would I tell the host is an Atomic host without Ansible? Then you can combine a command: with a register:clause, and run set_fact with a when: . For the effort, I'd just add a custom fact. But without knowing how to tell, that's tricky :) On 19 June 2017 at 17:00, Stéphane Klein

Re: [ansible-project] Find number of servers where something is true

2017-06-19 Thread Dick Davies
On 19 June 2017 at 17:13, Dick Davies <d...@hellooperator.net> wrote: > will let you make a group by fact, you could then just have a task > on localhost output '{{ groups["has_that_file"] _ length }}". sorry that should be: {{ groups["has_that_file"] | len

Re: [ansible-project] Find number of servers where something is true

2017-06-19 Thread Dick Davies
http://docs.ansible.com/ansible/group_by_module.html will let you make a group by fact, you could then just have a task on localhost output '{{ groups["has_that_file"] _ length }}". There's a set_fact task you can use to set a (boolean) fact on hosts, or just bite the bullet and write a custom

Re: [ansible-project] Jinja 2 template syntax error

2017-06-15 Thread Dick Davies
What does the generated config look like? The error is just redis-sentinel crashing. On 15 June 2017 at 17:47, Owen Corcoran wrote: > > Hi, > > > > Im having an issue with the following Jinja2 template and I just cant figure > out how to get it to display the ip4 addresses

Re: [ansible-project] Dependency check between roles

2017-05-22 Thread Dick Davies
gt; first time doing stuff and second not doing anything but spending time with >>> state checking. This is because the whole 'Dependencies are only installed >>> once unless allow_duplicates is yes' thing is scoped to the role. >>> >>> I'm currently creating a

Re: [ansible-project] Dependency check between roles

2017-05-18 Thread Dick Davies
I'd skip the dependency mechanics and just explicitly apply both roles in the play. On 18 May 2017 at 13:21, Jose Luis Fernández Pérez wrote: > Hi all! > > I need to disallow a role from being executed when it is include more than > once. The scenario is like this. > > Role

Re: [ansible-project] Re: SSH connection to host failed..

2017-05-13 Thread Dick Davies
ConnectTimeout=10 vzylvrnddev3 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-; LANG=C LC_CTYPE=C /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/setup; rm -rf

Re: [ansible-project] Multiple host files with host vars - what is the precedence?

2017-05-12 Thread Dick Davies
Silly question, but why? won't a group_vars/all do the trick? On 12 May 2017 at 09:11, Dan Bateman wrote: > I have a setup where I have multiple inventory files in a directory and my > ansible.cfg points to that inventory directory rather than a file. Also > using

Re: [ansible-project] Re: I want auto script,but something error

2017-05-10 Thread Dick Davies
Yes, but this : 192.168.30.75 remote_user=root remote_pass=1qaz@WSX says to login directly as root, so don't do that. The error is remote_user" chtadm instead of remote_user: chtadm On 10 May 2017 at 15:35, 王慧勳 wrote: > Hi Davies: > thanks,i cant direct use

Re: [ansible-project] Re: Is there any better way to find if a list of packes installed

2017-05-09 Thread Dick Davies
You'd probably get what you want from an Ansible dummy run then, just pass '--check' to ansible-playbook. On 9 May 2017 at 20:09, Kiran Kumar wrote: > Hi Tai Kedzierski , > > Thanks for your reply. Am intending only to validate if packages are > installed or not and am not

Re: [ansible-project] ansible ping hanging on a single node with no errors

2017-05-09 Thread Dick Davies
d running with - gives no clues at all. It > processes one host fine, then just hangs with no output at all. > > On Tue, 9 May 2017 at 4:09 am, Dick Davies <d...@hellooperator.net> wrote: >> >> Well, back to basics. >> >> Can you SSH to the server manually? >

Re: [ansible-project] using a "when" for setting environment ?

2017-05-08 Thread Dick Davies
I think that's setting an environment variable called 'when' with a value of 'use_apt_mirror'. On 8 May 2017 at 10:04, Stephen Tan wrote: > > Will this work? > > environment: > http_proxy: "{{ apt_mirror }}" > when: use_apt_mirror > > So, I only want to set the

Re: [ansible-project] ansible ping hanging on a single node with no errors

2017-05-08 Thread Dick Davies
Well, back to basics. Can you SSH to the server manually? If so, try adding '-' to the ping task to see if that gives any clues. On 8 May 2017 at 09:35, David Binney wrote: > I am trying to run an ansible ping, but it it hanging on a single hostname, > and showing no

Re: [ansible-project] trying to pass variable to hosts

2017-05-07 Thread Dick Davies
Those variables are set on localhost , not kfkahost0. Why don't you just put your kafka host in a group and use group_vars? On 7 May 2017 at 20:41, wrote: > I am trying to pass a variables to the hosts in a play > > - name: include vars > hosts: localhost >

Re: [ansible-project] How to get IP address from inventory file

2017-05-05 Thread Dick Davies
Your inventory doesn't say what you think it does. [clab111] is a group, not a host, and it contains one host called '11.11.11.11', and so on. Inventory docs are at: http://docs.ansible.com/ansible/intro_inventory.html , see if that makes it any clearer. On 4 May 2017 at 22:15, Mateusz

Re: [ansible-project] suggestion for using ~/.my.cnf file

2017-05-04 Thread Dick Davies
On 4 May 2017 at 20:12, cutiee wrote: > Output_error: > > failed: [10.100.140.230] => {"failed": true} > msg: unable to connect, check login credentials (login_user, and > login_password, which can be defined in ~/.my.cnf), check that mysql socket > exists and mysql

Re: [ansible-project] clients, products, applications ... inventory/host

2017-05-04 Thread Dick Davies
So each client has their own VM? If so, you can just set host_vars for each vm, and model each application as a role - like this: ├── inventory │ ├── host_vars │ │ ├── client1 <- sets some_variable1, some_variable2 for client1 │ │ ├── client2 │ │ └── client3 │ └── hosts ├── roles

Re: [ansible-project] Is there something like "group_files"

2017-05-04 Thread Dick Davies
Be wary of looking at Ansible with an MVC perspective; the burden of maintaining a few dozen YAML files and templates doesn't need the overhead of OOPs baggage, and in my experience the readability cost isn't worth it. That said: perhaps parameterised roles would do what you want? Passing in

Re: [ansible-project] get value from command line in playbook

2017-05-02 Thread Dick Davies
There probably is a way to hack it (e.g. inventory_file minus inventory_dir , see http://stackoverflow.com/questions/18839509/where-can-i-get-a-list-of-ansible-pre-defined-variables ) but I've done this myself by just setting a common variable in inv/*/group_vars/all and referencing that.

Re: [ansible-project] Python Annoying error when connecting to target machines

2017-05-02 Thread Dick Davies
It looks like your install of Python isn't complete, or you're missing some required env. vars. Back to your UNIX team? On 2 May 2017 at 18:24, Anthony Youssef wrote: > Hi, > > > i am facing an error that is blocking my work on ansible. i am trying to > connect from

Re: [ansible-project] New to Ansible - need to pull hostname and ip from facts for template.

2017-05-02 Thread Dick Davies
You can iterate over the group and access hostvars['server name']. Assuming your backends are in a group called 'backends' something like this should work: {% for host in groups['backends'] %} {% set h = hostvars[host] %} server name {{ h.name }} {{ h.ip }} check {% endfor %} On 1 May 2017 at

Re: [ansible-project] How to filter dictionary entries using Jinja

2017-04-27 Thread Dick Davies
If each mount was managed by a role, you could just apply those roles to the (groups holding) the relevant servers. You'll need to have multiple data structures, one per role, but that's probably going to 'work with the grain' of Ansible better. On 26 April 2017 at 15:20, Frank Thommen

Re: [ansible-project] How to check the physical memory and free disk is greater than some value?

2017-04-26 Thread Dick Davies
I'd use facts for that. The ones you want are probably ansible_memtotal_mb (total RAM in Mb) and ansible_mounts (which gives free bytes per mounted device) On 26 April 2017 at 15:16, Swathi Cutie wrote: > How to write an ansible task to check if the physical memory

Re: [ansible-project] New to ansible, trying to get ping to work but getting Paramiko/SSH errors

2017-04-26 Thread Dick Davies
An 'Ansible ping' checks that Python is on the remote host - cisco iOS probably doesn't have that, so you'd manage it with ansible modules running on your ansible host. On 25 April 2017 at 21:11, Mini wrote: > Hi Ravi, > > Could you please tell how you made it work. what does

Re: [ansible-project] Need help in exploring how to use regular expression to find the correct file name in a play book

2017-04-25 Thread Dick Davies
Might be better to list the files you want to edit as vars on each of the hosts in your inventory. On 25 April 2017 at 14:35, vinod kumar wrote: > Hi All, > > I am writing a play book to add below two lines to a service config file > under /etc/xinetd.d/. The

Re: [ansible-project] Re: getting error while trying to create my own role

2017-04-25 Thread Dick Davies
It is, or the task wouldn't have run. OP: Your role looks broken, but you haven't show that. Probably /usr/bin/lsb_release doesn't exist on localhost. On 25 April 2017 at 12:30, wrote: > > > your file role must be in the path

Re: [ansible-project] template backup names?

2017-04-24 Thread Dick Davies
I'm guessing its intended to prevent collisions rather than as an audit tool? On 21 April 2017 at 14:58, Dave Martin wrote: > So, why is there a process ID in the extension added to the backup file > created by a template action? Any why not put it at the end so they sort >

Re: [ansible-project] Seamless provisioning, install and configuration automation in Ansible

2017-04-18 Thread Dick Davies
gt; > Thanks, > > On Thursday, April 13, 2017 at 2:05:37 PM UTC-4, Dick Davies wrote: >> >> Are you able to modify the VM templates? That would be simplest. >> Depending on your virtualiser there is usually a way to run a 'first boot' >> step >> on newly create

Re: [ansible-project] Seamless provisioning, install and configuration automation in Ansible

2017-04-13 Thread Dick Davies
Are you able to modify the VM templates? That would be simplest. Depending on your virtualiser there is usually a way to run a 'first boot' step on newly created VMs; that might be another way to get the initial pubkey (that Ansible will use) installed. On 13 April 2017 at 03:23, Madhava Rao

Re: [ansible-project] How to detect which role called an other role in case of role dependency

2017-04-13 Thread Dick Davies
This sounds like you're re-discovering why OOP is such a pain in the arse. Sorry to be glib but I see this a lot and it's usually easier for everyone if you just avoid the whole meta dependency thing altogether, it's always a maintenance hassle. If you get this to work it's just another

Re: [ansible-project] ansible motd changed login prompt

2017-04-06 Thread Dick Davies
That looks like your inventory_hostname was an IP that started with 10 and the hostname pieces are splitting this like an FQDN. What does 'hostname' come back with now, I'm guessing '10'? On 5 April 2017 at 14:19, Robert Recchia wrote: > This is weird and I am not sure of

Re: [ansible-project] Installing preview module subscription-manager

2017-03-31 Thread Dick Davies
If you just make a directory library/ in your playbook directory and put the .py in there, Ansible should pick it up when you run your play. On 30 March 2017 at 22:38, William Muriithi wrote: > Good afternoon, > > > [william@cacti ~]$ ansible --version > ansible

Re: [ansible-project] "This module requires the passlib Python library"}

2017-03-29 Thread Dick Davies
what version of passlib? docs say 1.6 or better. IIRC EPEL6 has 1.5.something. EL7 should be ok. On 29 March 2017 at 17:52, Matthew Cooper wrote: > I'm hoping someone can help me out. > > I have a playbook to install Graylog2 on an EC2 host. The playbook fails on: > >

Re: [ansible-project] How to read sub-members from group, within YAML file (i.e. like custom Ansible hosts file)

2017-03-27 Thread Dick Davies
# you run this to create hosts and write the host file ansible-playbook -i host_file do_something.yml # use the generated file as an inventory On 27 March 2017 at 11:58, Bhavin Parmar <bhavinjpar...@gmail.com> wrote: > Thanks, Dick Davies, > > I have few related queries: >

Re: [ansible-project] How to read sub-members from group, within YAML file (i.e. like custom Ansible hosts file)

2017-03-27 Thread Dick Davies
That's an .ini file , not a yaml file. Why don't you just uncomment the key1= part? Then you can use it as an inventory directly and be able to access both instance-id and key1 as host vars. Personally I'd split this into 2 plays - one provisioner (that has the file creation as its last task)

Re: [ansible-project] Ansible not completely installing Elasticsearch RPM package via YUM

2017-03-21 Thread Dick Davies
I'd start by going through /var/log/yum.log, maybe something went boom and was logged there? On 21 March 2017 at 17:06, Tom Albrecht wrote: > This has me tearing my hair out, only because I don't know how to go about > debugging this. > > Versions: > # ansible --version >

Re: [ansible-project] Basic Ansible Ping Module Question

2017-03-20 Thread Dick Davies
Ansibles ping: task checks the host is 'manageable' - that login works, python is recent enough and can generate json. If the host is unreachable that sounds unlikely. Can you SSH to it? On 18 March 2017 at 20:08, jerewrig12345 wrote: > I'm just learning the Ansible basics

Re: [ansible-project] File name of the current playbook

2017-03-15 Thread Dick Davies
Simple but guaranteed to work: set a var in the playbook, use that. On 15 March 2017 at 13:07, wrote: > Hello, > > I was looking for a way to get the file name of the current playbook. > > Found an old thread, but no workarounds or solutions there. >

Re: [ansible-project] Put anisble up and running example in a role with add_host

2017-03-12 Thread Dick Davies
You could use delegation to run some of the tasks on another machine (in this case localhost). But to be honest I wouldn't, personally I'd split this into 2 plays. On 12 March 2017 at 04:33, Zhu Wayne wrote: > Is it possible to pack the following into a single role? My

Re: [ansible-project] Crons on a collection of servers

2017-03-08 Thread Dick Davies
Why don't you just set disabled: as a var, and then set that either true or false on each server/group as needed? On 8 March 2017 at 16:27, Ed Greenberg wrote: > We have a collection of load balanced web servers, and we have cron jobs > spread across the server base. > >

Re: [ansible-project] Failed to validate the SSL certificate for archive.apache.org:443

2017-03-07 Thread Dick Davies
gt; Like I said my field is not IT related, so if you could give me an exemple > how to do that I appreciate. > > > Pedro > > segunda-feira, 6 de Março de 2017 às 19:33:43 UTC, Dick Davies escreveu: >> >> Your python is a bit old, so it doesn't support SNI. >> >>

Re: [ansible-project] Failed to validate the SSL certificate for archive.apache.org:443

2017-03-06 Thread Dick Davies
Your python is a bit old, so it doesn't support SNI. To be fair the error message is pretty helpful. I'm starting to see this more and more as some bigger providers start to cut over to SNI. I just use a command: to fire off curl, that works fine (I don't fancy upgrading all my servers python

Re: [ansible-project] uri module and curl

2017-03-02 Thread Dick Davies
I was thinking of a wait_for: task *before* the uri: check, just to give tomcat enough time to start a http connector (I don't think wait_for on its own would work, as there's no option to send a GET to the port). The more I think about it, the more I prefer your idea; I've seen plenty of WARs

Re: [ansible-project] Re: Alternatives to ansible tower.

2017-03-02 Thread Dick Davies
Was about to suggest Rundeck (purely because we already use it for deployments, jenkins sounds like a good option too) - haven't tried this plugin myself but it looks interesting: https://github.com/Batix/rundeck-ansible-plugin On 2 March 2017 at 17:49, Simon Wydooghe

Re: [ansible-project] Variables and templates between roles

2017-02-28 Thread Dick Davies
If you load the apache role in a play and then your vhosts role, you should be able to use apache role vars (or set in defaults/ ) in the vhosts role, so long as both roles are in the same play. (we just did exactly this this afternoon, so let me know if it's not happening for any reason). On 28

Re: [ansible-project] uri module and curl

2017-02-28 Thread Dick Davies
It'd be worth checking if a command: task using curl works. If not it's probably a shell environment (proxy?) issue. I've seen curl work where get_url: / uri: doesn't if you are hitting an SNI endpoint, my workaround is a command: task. Issue here:

Re: [ansible-project] how to organize hosts

2017-02-26 Thread Dick Davies
Would separate inventories for UAT and Prod work? If you set the play to deploy each app to a group, you can put the same server into multiple inventory groups. so UAT inventory has the same server in both the app1 and app2 groups, but the Prod inventory has 2 servers in app1 but only one server

Re: [ansible-project] ValueError: No closing quotation

2017-02-21 Thread Dick Davies
You have a syntax error in your site.yml, probably an unterminated string. Try http://yamllint.com maybe? On 21 February 2017 at 06:14, Mona Gopal wrote: > Hi, > > ansible-playbook -i hosts site.yml - -c paramiko > Traceback (most recent call last): > File

Re: [ansible-project] Re: how to use ansible galaxy roles

2017-02-04 Thread Dick Davies
Yum isn't seeing the 'mysql-server' package in any of its configured repos. That's the right name for EL6 redhat/centos, maybe you're missing one of the base repos? Get that working first before you ask Ansible to install it, and things will be ok. On 3 February 2017 at 21:28, jithendra myla

Re: [ansible-project] Inventory Configuration

2017-02-04 Thread Dick Davies
The second command is what i'd expect to work. group_vars/ , host_vars/ etc are relative to the directory holding the 'hosts' static list. General rule: if you're going to target plays against different groups of servers, put them as groups in a single inventory. There'd be nothing wrong with a

Re: [ansible-project] adding a repo

2017-02-02 Thread Dick Davies
http://docs.ansible.com/ansible/yum_repository_module.html cheers! On 2 February 2017 at 14:47, jithendra myla wrote: > Hi Sir/Madam, > > Does ansible have any module for adding new repository in Centos/Redhat > Linux, i know it have apt_repository for debian. > > Thank you

Re: [ansible-project] Ansible best practice

2017-01-31 Thread Dick Davies
Just apply both roles to your mongodb group, and if you want to be explicit you'd just set some vars on that group that both roles can use to find paths etc. On 31 January 2017 at 13:35, Rui Goncalves wrote: > Hi all, > > I have no experience writing ansible roles. At the

[ansible-project] managing xml fragments a la lineinfile

2017-01-30 Thread Dick Davies
Does anyone here a good tip for managing parts of xml files (like lineinfile / blockinfile but xml-aware)? I have several fairly complex apps to manage, each with their own role. Ideally they'd each manage their own subset of the domain.xml, which rules out a single domain.xml template.

Re: [ansible-project] PostgreSQL 9.5 or Higher installation on Ubuntu 14.04 LTS

2017-01-30 Thread Dick Davies
The error looks a lot like apt-get is unable to find the packages you want. Until you fix that I don't think there's much Ansible can do, it's just asking apt-get to install the packages you specify. On 30 January 2017 at 15:54, Shyam Yenna wrote: > I posted exact error

Re: [ansible-project] Version dependency management

2017-01-27 Thread Dick Davies
Hi Adam I'd put the servers into groups, and then use group_vars to set specific versions. On 27 January 2017 at 15:39, Adam Shantz wrote: > Hi all - > > We're using Ansible, but haven't gotten super advanced. I have a challenge > where I'm doing rolling upgrades across

Re: [ansible-project] Re: SSH via Jumpbox

2017-01-11 Thread Dick Davies
So you all use roots private key on the jumpbox to access the protected servers? Forgive me but that seems a bit backwards - you lose audit trail for the servers being accessed, since you're all logging in with the same private key (i.e. roots key on the jump host). We generally ssh to our jump

Re: [ansible-project] Ansible enhancement request: persistent variables?

2016-12-21 Thread Dick Davies
My worry about that sort of approach is it assumes the local playbook directory is authoritative - in our case several people have access to run our playbooks, so that would get messy very quickly. Keeping state on the managed hosts would be a better idea, and in that case you could keep 'lock

Re: [ansible-project] How can I change the path for specific host

2016-12-12 Thread Dick Davies
If they're in different groups, make the path a group var. If they're in the same groups, make the path a host var. On 12 December 2016 at 14:29, Guilherme Ueno wrote: > Hi all, > > I have to copy a file into a directory to specific hosts, but the path > changes for

Re: [ansible-project] Ansible Can not handle .tar.gz file and gives error

2016-12-09 Thread Dick Davies
It's not looking very much like an Ansible problem from where I'm sat. Do you have e.g. a proxy environment variable set in your shell running wget that you haven't set in the ansible task? On 9 December 2016 at 15:42, Balu Kompalli wrote: >> Yes, That link is fine. But

Re: [ansible-project] Unable to Install PostgreSQL using Ansible

2016-11-29 Thread Dick Davies
On 25 November 2016 at 13:33, Gustavo da Silva Carita wrote: > Hello Everyone, >> become_user: postgres >> become: true ... ... > "module_stdout": "sudo: a password is required\r\n", > "msg": "MODULE FAILURE" Ansible needs a password so it can

Re: [ansible-project] Possible Improvement to the 'command' Module

2016-11-26 Thread Dick Davies
It's not a bad idea, but it would need a bit of work to cater to things like directories. I often use a task like this to create automatically versioned directory names if I can't find an RPM: - name: extract {{ foobar_version }}.tgz unarchive: src=/tmp/{{ foobar_version }}.tgz

Re: [ansible-project] Re: Ansible yum module unable to find certain packages

2016-11-24 Thread Dick Davies
Isn't that because those packages are from EPEL ? You need to add the repo in one task, and then add the other packages in the second. On 24 November 2016 at 12:57, 'Jeffrey Wen' via Ansible Project wrote: > Hey Alexander, > > Thank you so much for helping me

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Dick Davies
r 2016 at 14:58, Jon Forrest <nob...@gmail.com> wrote: > > > On 11/22/16 12:14 AM, Dick Davies wrote: >> >> That playbook tells ansible to create the template on the 'all' group >> i.e. everything in the inventory. >> >> That's what it's trying to do. > &g

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Dick Davies
That playbook tells ansible to create the template on the 'all' group i.e. everything in the inventory. That's what it's trying to do. for your use case, just make 2 roles: ntp_server and ntp_client, and apply them to groups as required. On 22 November 2016 at 05:58, Jon Forrest

Re: [ansible-project] Can Ipaddress of the target be fetched by ansible?

2016-11-12 Thread Dick Davies
It's hard to give details because you haven't explained why you don't know the IP. I've used multicast DNS (via avahi ) on DHCP booted Raspberry Pis to advertise hostnames, then put those hostnames into groups in flat file inventories. That means the servers can change IP without having to

  1   2   3   >