[ansible-project] FQDN in playbook but not in inventory file - skipping: no hosts matched

2017-07-20 Thread Listing
Hi all, When specifying an host in the playbook itself but not in the inventory file, I get the message 'skipping: no hosts matched.' When I pass the host via: ansible-playbook playbook.yml -i hostname, All is just working fine. But why is Ansible unable to just pick up this host defined in

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

2017-07-15 Thread Listing
Cool, did not know that! Thnx for your help. On Friday, July 14, 2017 at 8:05:21 PM UTC+2, Kai Stian Olstad wrote: > > On 14. juli 2017 19:46, Listing wrote: > > This indeed seems to be the case when I compared paths. How is this > > possible? The 'remote' machine is the

Re: [ansible-project] Lineinfile - replacing regex instead of placing text after insertafter

2017-07-15 Thread Listing
? On Tuesday, May 30, 2017 at 9:02:44 AM UTC+2, Kai Stian Olstad wrote: > > On 29.05.2017 16:26, Listing wrote: > > Hi Kai, > > > > Thank you for your reply. But what is the difference then between > > regexp > > and insertafter etc? Is regexp always bei

[ansible-project] Neatest way to automate role installation

2017-07-14 Thread Listing
Hi guys, I want to install a role automatically via a playbook. But what would be the best way to do this? Is that by using the shell/command module and then 'ansible-galaxy install', or is there something better available? -- You received this message because you are subscribed to the Google

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

2017-07-14 Thread Listing
. It's in your path on localhost, and > not on the account you're using remotely. > > On 13 July 2017 at 22:05, Listing <mens...@gmail.com > > wrote: > > Hi, > > > > I am trying to run the following playbook: > > > > --- > > - hosts: m

[ansible-project] Re: better way to manage users on unix machine

2017-07-14 Thread Listing
Can you show me the playbook you are using? On Friday, July 14, 2017 at 9:01:35 AM UTC+2, Suresh Prajapati wrote: > > Hi Guys, > > > I am using a list of users to define the exact set of user accounts I need > on all of my managed compute instances. > > For example: > > --- > users: > - {

[ansible-project] Re: Alternative for blockinfile in Ansible 1.9

2017-07-14 Thread Listing
Have you considered lineinfile? On Friday, July 14, 2017 at 9:14:14 AM UTC+2, Selvakumar Ponnusamy wrote: > > I know we can use blockinfile in Ansible 2. Is there any way to achieve > same in Ansible 1.9 > -- You received this message because you are subscribed to the Google Groups "Ansible

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

2017-07-13 Thread Listing
Hi, I am trying to run the following playbook: --- - hosts: mymachine.lan become: true tasks: - name: shell shell: "ambari-server status" The problem is that this results in the following output: [ansi...@mymachine.lan ~]$ ansible-playbook shell.yml PLAY [mymachine.lan]

Re: [ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Listing
On Thursday, July 6, 2017 at 10:58:18 PM UTC+2, Kai Stian Olstad wrote: > > On 06. juli 2017 22:47, Listing wrote: > > with_items: groups['all:!excluded_group'] does not seem to work. Have > you > > got any idea how to exclude here? :) > > with_items: "{{ g

[ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Listing
HI al, I am running a playbook on a set of hosts of which I expect them to be offline. I want to check every 10 seconds whether they are online or not and then output a message when all is running, or another message when all is not running after 10 retries for instance. I am getting 'host

[ansible-project] Creating a playbook that installs a role - best practice

2017-07-02 Thread Listing
Hi guys, I am looking for the best way to automatically install a role from a source. I am currently using these two ways: 1. via requirements.yml file --- - src: geerlingguy.ruby Then by running the following playbook (install.yml): --- - hosts: all tasks: - name: run ansible galaxy

[ansible-project] Privilege escalation - what is best practice?

2017-06-26 Thread Listing
Hi all, I am running my playbooks as user ansible (which has sudo rights) for instance but often need to escalate privileges. This can be done in multiple ways: 1. specify per task: become=true 2. specify for the entire playbook at the beginning: become=true 3. specify for the entire host via

[ansible-project] Ansible role: test/test.yml

2017-06-14 Thread Listing
Hi, When initiating a role I noticed that there is a test folder being created with test.yml in it. When I run my roles in production environments, I always run roles by creating a playbook with the following contents: --- - hosts: webservers roles: - common - webservers When

Re: [ansible-project] Role dependencies not being installed automatically

2017-06-13 Thread Listing
Ok cool, thanks! On Tuesday, June 13, 2017 at 7:39:57 PM UTC+2, Brian Coca wrote: > > It is a runtime import, it has nothing to do with installation. > > > -- > Brian Coca > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Role dependencies not being installed automatically

2017-06-13 Thread Listing
On Tuesday, June 13, 2017 at 7:35:55 PM UTC+2, Brian Coca wrote: > > They are not installed automatically. > > > -- > Brian Coca > Ah, so they are just there for the users that use this role so they can install the roles manually and then it will be included? -- You received this

[ansible-project] Role dependencies not being installed automatically

2017-06-13 Thread Listing
the following error: ERROR! the role 'geerlingguy.php' was not found in /etc/ansible/roles/roles:/etc/ansible/roles:/etc/ansible/roles:/etc/ansible/roles The error appears to have been in '/etc/ansible/roles/listing/meta/main.yml': line 56, column 5, but may be elsewhere in the file depending

Re: [ansible-project] Lineinfile - replacing regex instead of placing text after insertafter

2017-05-30 Thread Listing
Very clear, thank you! On Tuesday, May 30, 2017 at 9:02:44 AM UTC+2, Kai Stian Olstad wrote: > > On 29.05.2017 16:26, Listing wrote: > > Hi Kai, > > > > Thank you for your reply. But what is the difference then between > > regexp > > and insertafter

Re: [ansible-project] Lineinfile - replacing regex instead of placing text after insertafter

2017-05-29 Thread Listing
Hi Kai, Thank you for your reply. But what is the difference then between regexp and insertafter etc? Is regexp always being replaced? Or what is exactly the logic? On Sunday, May 28, 2017 at 7:38:16 PM UTC+2, Kai Stian Olstad wrote: > > On 28. mai 2017 11:53, Listing wrote: >

[ansible-project] Lineinfile - replacing regex instead of placing text after insertafter

2017-05-28 Thread Listing
Hi guys, I have some problems with the lineinfile module. I try to add 'inserted_text' after '#insertbelow' when 'this' has been found in /etc/ansible/lineinfile/lol. This is my task: --- - hosts: localhost tasks: - name: lol lineinfile: path: /etc/ansible/lineinfile/lol

Re: [ansible-project] Using multiple machine credentials when running a job template in Tower

2017-05-21 Thread Listing
: > > For tower questions and support please utilize > https://access.redhat.com/products/ansible-tower-red-hat > > This mailing list is for the open source ansible project. > > > > On Sun, May 7, 2017 at 11:38 AM Listing <mens...@gmail.com > > wrote: > >> Hi,

[ansible-project] Re: lineinfile - simply replace a string

2017-05-16 Thread Listing
FWIW: you can also use grep or sed in command and then register the result. If you then output result.stdout you will get the result of the grep/sed. On Tuesday, May 16, 2017 at 7:17:29 AM UTC+2, AnsiNoob wrote: > > Hi > > Two things that I miss in Ansible when compared to shell scripting is

[ansible-project] Use cases for set_fact instead of defining vars

2017-05-13 Thread Listing
Hi, You have set_fact and the ability to set vars, but when should one use set_fact? In the ansible-doc I see the following example, but when setting 'one_fact', what is the benefit instead of defining a var? Wouldn't it be possible to define vars per host as well? I hope someone can explain

[ansible-project] Re: group variable in with_items

2017-05-13 Thread Listing
What happens if you add 'register: blah'? So like this: - name: Evaluate oo_all_hosts add_host: name: "{{ item }}" groups: oo_all_hosts ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_become: "{{ g_sudo | default(omit) }}" with_items: "{{ g_all_hosts

[ansible-project] Re: Ping my virtual machine through Ansible

2017-05-13 Thread Listing
Hi Bob, What happens if you do 'ssh '? Do you still need to provide a password? Ping in this module is not the ping we are used to use, it just establishes a connection and returns 'pong' if all is working. It is not doing an ICMP ping (which I think you are expecting). On Saturday, May 13,

[ansible-project] Using multiple machine credentials when running a job template in Tower

2017-05-07 Thread Listing
Hi, When running a job template in Ansible-Tower I notice that I can only select one credential per job run. I have many machines in my inventory with different credentials and occasionally I would like to connect with passwords instead of private keys. I can get this to work just perfectly

[ansible-project] Ansible-doc - is everything in it?

2017-03-27 Thread Listing
Hi, Sometimes I need (offline) information about how to use specific arguments on modules like 'with_items', 'with_files', 'tags', 'when' etc. I would then like to use ansible-doc to get my playbook done, but I seem to be unable to find information in ansible-doc about this. Is this present?