[ansible-project] Advice needs for Ansible Tower Installation

2017-09-05 Thread Nuwan Vithanage
 

Hope your doing good. Appriciate if you can let me know answers below 
concerns 


I need advice from you appreciate if you can provide advice regarding below 
concerns.


When I install ansible tower Do i need to install ansible 1st ?

Where I can define inventory /etc/ansible/hosts or other place ?

How can I install LAMP on web server which is define in /etc/ansible/hosts 
using Ansible tower?

-- 
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/09f411e7-4644-49fd-af9c-fe822835f411%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] BigIP_Pool monitor template not found

2017-09-05 Thread Tim
Sean, try the module found in the f5-ansible side-band repository here. It
will be upstreamed once the new dev window for Ansible is opened.

https://github.com/F5Networks/f5-ansible/blob/devel/library/bigip_pool.py

-tim

On Tue, Sep 5, 2017 at 12:43 PM, Sean G.  wrote:

>
> I have a play that works when I use:
> monitors: "/Common/http"  or any of the other default montors, but when I
> try to use one that I created manually I get "01070022:3: The monitor
> template /Common/SPIFFYCUSTOM_MONITOR was not found.'"
>
> - name: Create or Config non-clientweb Pools
>   bigip_pool:
> lb_method: "least_connection_member"
> monitors:  "/Common/SPIFFYCUSTOM_MONITOR"
> name:  "{{ item | upper }}_80_POOL"
> server: "{{ inventory_hostname }}"
> slow_ramp_time: "120"
> state: present
> user: "{{ f5_user }}"
> password: "{{ f5_pass }}"
>   with_items: "{{ Pools }}"
>   delegate_to: localhost
>
> It works fine if I add the custom monitor via the GUI client after the
> pool is created, am I missing something on the path to the monitor?
>
> -Sean
>
> --
> 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/25d60d37-5624-47a8-9b8f-8f108863d61a%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/CAB0Zv8gXPvZ%2Bscw1j20_jrgJhD1Ms1XGsXZ4-UmxnOFg5Zp5hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Role issue - formatting tasks

2017-09-05 Thread ThatGuyDoingStuff

>
> Initialized the ansible role with command line call.
> Role fails with this error:
>
>
>
> tasks/main.yml
>
> # Configure MySQL 5.6 repos for Xenial and above.
>
> - include: mysql_repos.yml
>
> - inlcude: folder_check.yml
>
> - inlcude: flyway_git.yml
>
> - include: flyway.yml
>
>
>
>
>
> example of one of the tasks i made that is included above:
>
> ---
#- name: Clone a private repository into /git in the ubuntu home folder.

- git:

repo: "{{ item }}"

version: master

dest: {{ git_folder_location }}

accept_hostkey: yes

  # ssh-agent doesn't allow key to pass through remote sudo commands.

  become: no

  with_items:

- {{ git_repos }}


#TODO: add logic for the env.sh.template copy and value changes

#- name: Set Environment variables from each repo

#TODO: Setup a wait/check for flyway to be installed 

#TODO: Next execute setup under db_migrations/

#- name: DB migrations execute setup
#TODO: run migrations

#- name: Check setup.sh for migrations

- stat: path={{ git_folder_location }}/db_migrations/bin/setup.sh

  register: setup_sh


#- name: Check migrate.sh for migrations

- stat: path={{ git_folder_location }}/db_migrations/bin/migrate.sh

  register: migrate_sh


#- name: Run setup for migrations

- shell: bash {{ git_folder_location }}/db_migrations/bin/setup.sh

  when: setup_sh.stat.exists and setup_sh.stat.executable


#- name: Run migrate for migrations

- shell: bash {{ git_folder_location }}/db_migrations/bin/migrate.sh

  when: migrate_sh.stat.exists and migrate_sh.stat.executable






 

> Another sample task file:
>
> folder_check.yml
> ---
>
>
>
> - name: "Creating multiple by checking folders"
>
>   tasks:
>
>   - block:
>
> - name: "Checking folders"
>
>   stat:
>
>path: "{{item}}"
>
>   register: folder_stats
>
>   with_items:
>
>   - {{ git_folder_location }}
>
> - name: "Creating multiple folders without disturbing previous 
> permissions"
>
>   file:
>
>path: "{{item.item}}"
>
>state: directory
>
>mode: 0755
>
>group: {{ git_folder_group }}
>
>owner: {{ git_folder_owner }}
>
>   when: item.stat.exists == false
>
>   with_items:
>
>   - "{{folder_stats.results}}"
>
>
>
>
> Error:
>
> ERROR! no action detected in task. This often indicates a misspelled 
> module name, or incorrect module path
>
>
>
> What is wrong with the task(s)?
>
>
> PS 
> If more info is needed please let me know
>
> Thanks in advance.
>
>

-- 
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/496ee029-1040-4f84-be91-49884ec594ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible role - created role that includes tasks, variables, default values ...

2017-09-05 Thread ThatGuyDoingStuff


On Tuesday, September 5, 2017 at 5:17:13 PM UTC-4, Abe Figueroa wrote:
>
>
> Initialized the ansible role with command line call.
> Role fails with this error:
>
>
>
> tasks/main.yml
>
> # Configure MySQL 5.6 repos for Xenial and above.
>
>
>
> - include: mysql_repos.yml
>
> - inlcude: folder_check.yml
>
> - inlcude: flyway_git.yml
>
> - include: flyway.yml
>
 

> example of one of the tasks i made that is included above:
>
>
>
>
> ---
>
> #- name: Clone a private repository into /git in the ubuntu home folder.
>
> - git:
>
> repo: "{{ item }}"
>
> version: master
>
> dest: {{ git_folder_location }}
>
> accept_hostkey: yes
>
>   # ssh-agent doesn't allow key to pass through remote sudo commands.
>
>   become: no
>
>   with_items:
>
> - {{ git_repos }}
>
>
>
>
> #TODO: add logic for the env.sh.template copy and value changes
>
> #- name: Set Environment variables from each repo
>
>
>
>
> #TODO: Setup a wait/check for flyway to be installed 
>
>
>
>
> #TODO: Next execute setup under db_migrations/
>
> #- name: DB migrations execute setup
>
>
>
>
> #TODO: run migrations
>
> #- name: Check setup.sh for migrations
>
> - stat: path={{ git_folder_location }}/db_migrations/bin/setup.sh
>
>   register: setup_sh
>
>
>
>
> #- name: Check migrate.sh for migrations
>
> - stat: path={{ git_folder_location }}/db_migrations/bin/migrate.sh
>
>   register: migrate_sh
>
>
>
>
> #- name: Run setup for migrations
>
> - shell: bash {{ git_folder_location }}/db_migrations/bin/setup.sh
>
>   when: setup_sh.stat.exists and setup_sh.stat.executable
>
>
>
>
> #- name: Run migrate for migrations
>
> - shell: bash {{ git_folder_location }}/db_migrations/bin/migrate.sh
>
>   when: migrate_sh.stat.exists and migrate_sh.stat.executable
>
 

> Another sample task file:
>
> folder_check.yml
>
 


---

- name: "Creating multiple by checking folders"

  tasks:

  - block:

- name: "Checking folders"

  stat:

   path: "{{item}}"

  register: folder_stats

  with_items:

  - {{ git_folder_location }}

- name: "Creating multiple folders without disturbing previous 
permissions"

  file:

   path: "{{item.item}}"

   state: directory

   mode: 0755

   group: {{ git_folder_group }}

   owner: {{ git_folder_owner }}

  when: item.stat.exists == false

  with_items:

  - "{{folder_stats.results}}"




>
> Error:
>
> ERROR! no action detected in task. This often indicates a misspelled 
> module name, or incorrect module path
>
>
>
>
>
> What is wrong with the task(s)?
>
>
> PS 
> If more info is needed please let me know
>
> Thanks in advance.
>
>
>

-- 
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/0b064343-e6ce-4b3a-bb96-7d69d579fbf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible role - created role that includes tasks, variables, default values ...

2017-09-05 Thread Abe Figueroa

Initialized the ansible role with command line call.
Role fails with this error:



tasks/main.yml

# Configure MySQL 5.6 repos for Xenial and above.

- include: mysql_repos.yml

- inlcude: folder_check.yml

- inlcude: flyway_git.yml

- include: flyway.yml

example of one of the tasks i made that is included above:

---

#- name: Clone a private repository into /git in the ubuntu home folder.

- git:

repo: "{{ item }}"

version: master

dest: {{ git_folder_location }}

accept_hostkey: yes

  # ssh-agent doesn't allow key to pass through remote sudo commands.

  become: no

  with_items:

- {{ git_repos }}


#TODO: add logic for the env.sh.template copy and value changes

#- name: Set Environment variables from each repo


#TODO: Setup a wait/check for flyway to be installed 


#TODO: Next execute setup under db_migrations/

#- name: DB migrations execute setup


#TODO: run migrations

#- name: Check setup.sh for migrations

- stat: path={{ git_folder_location }}/db_migrations/bin/setup.sh

  register: setup_sh


#- name: Check migrate.sh for migrations

- stat: path={{ git_folder_location }}/db_migrations/bin/migrate.sh

  register: migrate_sh


#- name: Run setup for migrations

- shell: bash {{ git_folder_location }}/db_migrations/bin/setup.sh

  when: setup_sh.stat.exists and setup_sh.stat.executable


#- name: Run migrate for migrations

- shell: bash {{ git_folder_location }}/db_migrations/bin/migrate.sh

  when: migrate_sh.stat.exists and migrate_sh.stat.executable

Another sample task file:

folder_check.yml

---

- name: "Creating multiple by checking folders"

  tasks:

  - block:

- name: "Checking folders"

  stat:

   path: "{{item}}"

  register: folder_stats

  with_items:

  - {{ git_folder_location }}

- name: "Creating multiple folders without disturbing previous 
permissions"

  file:

   path: "{{item.item}}"

   state: directory

   mode: 0755

   group: {{ git_folder_group }}

   owner: {{ git_folder_owner }}

  when: item.stat.exists == false

  with_items:

  - "{{folder_stats.results}}"


Error:

ERROR! no action detected in task. This often indicates a misspelled module 
name, or incorrect module path

What is wrong with the task(s)?


PS 
If more info is needed please let me know

Thanks in advance.


-- 
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/0cb0aaa0-58e7-47a0-ae97-bd2ca041301e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Newbie question on syntax

2017-09-05 Thread Jean-Yves LENHOF


Le 05/09/2017 à 22:26, Kenny Barnes a écrit :
> Thanks but I moved like so and now get another error.
>
>  tasks:
>   - name: Pull WWPNs from UCS
>  getucswwpns:
>host={{ inventory_hostname }}
>ucs_user="config"
>ucs_pass="config"
>outputfile=output.txt
>logfile=log.txt
>
>
> The offending line appears to be:
>
>   - name: Pull WWPNs from UCS
>  getucswwpns:
>   ^ here

Hi,

All your problems lies to some wrong indentation...

Please read :
http://docs.ansible.com/ansible/latest/YAMLSyntax.html
and
http://docs.ansible.com/ansible/latest/playbooks_roles.html#task-versus-play-includes

in your last error, getucswwpns need to be aligned to name...

Regards,

JYL

-- 
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/abf849c1-1247-c70f-b424-67e4a0ba1bab%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Newbie question on syntax

2017-09-05 Thread Kenny Barnes
Thanks but I moved like so and now get another error.

 tasks:
  - name: Pull WWPNs from UCS
 getucswwpns:
   host={{ inventory_hostname }}
   ucs_user="config"
   ucs_pass="config"
   outputfile=output.txt
   logfile=log.txt


The offending line appears to be:

  - name: Pull WWPNs from UCS
 getucswwpns:
  ^ here


On Tuesday, September 5, 2017 at 3:24:38 PM UTC-4, Sieds Pallas wrote:
>
>
>
> Op dinsdag 5 september 2017 20:51:55 UTC+2 schreef Kenny Barnes:
>>
>> Keep getting an error when running the following playbook.  Copied from 
>> gethub and watch youtube running the same w/o error. 
>>
>> Error:
>>
>> The offending line appears to be:
>>
>>   tasks:
>> - name: Pull WWPNs from UCS
>>   ^ here
>>
>  
>
>> Indentation?
>>
> I think the dash needs to align with the t of task
>  
>

-- 
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/cd3772db-3f81-4968-a51a-8bb1b70b94ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] BigIP_Pool monitor template not found

2017-09-05 Thread Sean G.

I have a play that works when I use: 
monitors: "/Common/http"  or any of the other default montors, but when I 
try to use one that I created manually I get "01070022:3: The monitor 
template /Common/SPIFFYCUSTOM_MONITOR was not found.'"

- name: Create or Config non-clientweb Pools
  bigip_pool:
lb_method: "least_connection_member"
monitors:  "/Common/SPIFFYCUSTOM_MONITOR"
name:  "{{ item | upper }}_80_POOL"
server: "{{ inventory_hostname }}"
slow_ramp_time: "120"
state: present
user: "{{ f5_user }}"
password: "{{ f5_pass }}"
  with_items: "{{ Pools }}"
  delegate_to: localhost

It works fine if I add the custom monitor via the GUI client after the pool 
is created, am I missing something on the path to the monitor?

-Sean

-- 
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/25d60d37-5624-47a8-9b8f-8f108863d61a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Newbie question on syntax

2017-09-05 Thread Sieds Pallas


Op dinsdag 5 september 2017 20:51:55 UTC+2 schreef Kenny Barnes:
>
> Keep getting an error when running the following playbook.  Copied from 
> gethub and watch youtube running the same w/o error. 
>
> Error:
>
> The offending line appears to be:
>
>   tasks:
> - name: Pull WWPNs from UCS
>   ^ here
>
 

> Indentation?
>
I think the dash needs to align with the t of task
 

-- 
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/99804651-5181-4ffb-8366-d6447ec47c44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Newbie question on syntax

2017-09-05 Thread Kenny Barnes
Keep getting an error when running the following playbook.  Copied from 
gethub and watch youtube running the same w/o error. 

---
- name: Get Existing UCS Information
  hosts: ucs (Runs on UCS group in the inv file)
  connection: local
  gather_facts: no

  tasks:
- name: Pull WWPNs from UCS
  getucswwpns:
host={{ inventory_hostname }}
ucs_user="config"
ucs_pass="config"
outputfile=output.txt
logfile=log.txt


Error:

The offending line appears to be:

  tasks:
- name: Pull WWPNs from UCS
  ^ here


Any help appreciated. 

-- 
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/62d7ec98-de20-4798-912b-02d79e36f565%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible SSH as one user and Sudo as another

2017-09-05 Thread prakash ranjan
Hi,

This is what I'm getting:-

Working without sudo. But not with sudo option.

ansibledir$ ansible all -m command -a 'whoami'
 | SUCCESS | rc=0 >>
pranjan

ansibledir$ ansible all -m command -a 'whoami' --sudo -K
SUDO password: 
 | FAILED! => {
"changed": false, 
"failed": true, 
"module_stderr": "Shared connection to dc1-io-new closed.\r\n", 
"module_stdout": "\r\nSorry, user pranjan is not allowed to execute 
'/bin/sh -c echo BECOME-SUCCESS-bgclrmmybsvnbasemntshqvjavcnqvjf; 
/usr/bin/python 
/home/pranjan/.ansible/tmp/ansible-tmp-1504636239.12-238251240956861/command.py;
 
rm -rf 
\"/home/pranjan/.ansible/tmp/ansible-tmp-1504636239.12-238251240956861/\" > 
/dev/null 2>&1' as root on \r\n", 
"msg": "MODULE FAILURE", 
"rc": 1
}

Please help on this.

Thanks
Prakash

On Wednesday, January 21, 2015 at 8:51:46 AM UTC-8, tkuratomi wrote:
>
> On Wed, Jan 21, 2015 at 8:05 AM, Stuart Budd  > wrote: 
> > I still do not understand this. 
> > 
> > 
> > Example 1: 
> > 
> > Ansible Local Server   Remote server 
> > local-01 remote-01 
> > ---  
> > Local user foo--> ssh -->Remote user foo 
> > 
> > 
> > I do not understand how Ansible knows what user account to use on the 
> local 
> > and remote servers for the purposes of the SSH connection if no user 
> account 
> > is specified within the command line  ( ansible_ssh_user=foo ) or 
> > /etc/ansible/hosts file. 
> > 
>
> Ansible (and the ssh commandline) defaults to using the same username 
> on the remote server as you are logged into on the local server. 
>
> So if nothing is specified, If you invoke ansible from the local user 
> foo account, ansible will attempt to connect to a remote user foo 
> account. 
>
> > I will ask a new separate question. 
> > 
> > 
> > Example 2: 
> > 
> > Ansible Local Server   Remote server 
> > local-01 remote-01 
> > ---  
> > Local user foo--> ssh -->Remote user foo 
> > bar 
> > (foo user uses sudo to run command as bar) 
> > 
> > I still can not get this to work. The SSH connection is working fine for 
> > user foo and if the foo user uses sudo to run a command as user bar on 
> the 
> > remote server it works fine but I still can not get Ansible to glue it 
> > together. 
> > 
> This should work.  Try something like this: 
>
> $ ansible rhel7-test --sudo -K -a 'whoami' 
> sudo password: 
> rhel7-test | success | rc=0 >> 
> root 
>
> $ sudo vim /etc/ansible/ansible.cfg 
> $ # Edit the sudo_user config so that: sudo_user  = ansibletest1 
> $ ansible rhel7-test --sudo -K -a 'whoami' 
> sudo password: 
> rhel7-test | success | rc=0 >> 
> ansibletest1 
>
> > I will ask a separate question about this. 
> > This was my main question really. I have one non-root user that allows 
> SSH, 
> > but can not use sudo for root access. 
> > So I can not use the same example as above. 
> > 
> This sounds slightly problematic 
> *  To be able to administrate this box at all you'll need a chain of 
> accounts from the account you ssh in as to an account that has all of 
> the privileges that you need (usually the root account so that you can 
> do anything you need). 
> * To be able to run ansible efficiently you should have an account 
> that can ssh in and either has the privileges you need or be one sudo 
> or su login away from the account that has all the privileges you 
> need. 
>
> However all is not lost because: 
> * You can be more than one sudo login away (as bcoca's explanation was 
> showing) but that is harder to achieve, has many caveats, and is much 
> harder to explain clearly :-) 
> * If you have an account that can sudo to root you should be able to 
> either add the account you can ssh in as to /etc/sudoers or add SSH 
> keys to the account that you can sudo to root from so that you can SSH 
> into the box as the aaccount that's only one sudo step away from root. 
>
> -Toshio 
>

-- 
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/64573e96-886a-4ae8-abfa-2421a7b87519%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Q: Obscure standard variables?

2017-09-05 Thread Sieds Pallas
Hi,
I am working trhough some tutorials, and I have a question; I hope this is 
the proper forum to post it.
In the solution provided with the tutorial I see some variables used that I 
do not understand:

inventory_hostname 
and:
groups["webservers"]

I do not find these in the ansible facts (`ansible servera -m setup`).
Also I cannot evaluate them using JINJA2 template "{{ inventory_hostname 
}}", apparently they are something else.
"webservers" is a group in my inventory, but where is the hash "groups" 
defined or coming from?

The documentation appears to be silent about these things.

On a related note, how am I supposed to evaluate variables from the facts?  
e.g. "{{ ansible_memory_mb}}" gives an error stating that I am not allowed 
to use JINJA2 templates here.

Tom

-- 
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/cc33b330-55c0-4b52-9293-11d956085430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible winrm to connect to windows guest via certificate.

2017-09-05 Thread Rui Pereira


sexta-feira, 4 de Agosto de 2017 às 07:52:20 UTC+1, Jordan Borean escreveu:
>
> Certificate auth is a bit of a pain with WinRM, I found the best article 
> to get this working would be 
> http://www.hurryupandwait.io/blog/certificate-password-less-based-authentication-in-winrm.
>  
> Personally I would say NTLM is more secure than Basic auth as you are not 
> sending the actual password to the server (rather a hash of the password). 
> You also have CredSSP as an option with local accounts but there is not 
> much point using that is using local accounts.
>

-- 
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/98846728-6c33-4b6b-b9b8-fa01aba9067f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to get all the instances per VPC and get security group of each instance for a particular zone.

2017-09-05 Thread Nirjhar Banik
Thanks Pshem, worked for me!

Cheers!
Nirjhar


On Monday, September 4, 2017 at 4:13:13 PM UTC+5:30, Pshem Kowalczyk wrote:
>
> You need a number of separate steps:
>
> 1. Get VPC id  (ec2_vpc_net_facts)
> 2. Get list of instances in that VPC using vpc-id as a filter 
> (ec2_remote_facts)
> 3. Get the list of ENIs for each of those EC2 instances (ec2_eni_facts)
>
> The last module will return information about security groups used by the 
> ENIs.
>
> kind regards
> Pshem
>
>
>
>
> On Mon, 4 Sep 2017 at 22:12 Nirjhar Banik  > wrote:
>
>> I'm trying to pull all the information of all the instances per VPC and 
>> get security group of each instance for a particular zone. I am using 
>> *ec2_vpc* (it is deprecated) module to get the information about 
>> an existing VPC but from reading the docs, I'm not completely sure this 
>> is possible since all the docs and examples are assuming you are 
>> either creating a VPC or deleting one.
>>
>> Can anyone help me with a solution of how to get the full list of ec2 
>> instance info for a particular region? Thanks!
>>
>> ---
>>  - name: List all the vpc ids
>>hosts: webservers
>>tasks:
>> - name: ec2 instances
>>   ec2_vpc :
>>aws_access_key: XX
>>aws_secret_key: 
>>   with_items:  
>>-  us-east-1 
>>   register: vpc_info
>>
>> -- 
>> 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/1d0ae7b5-f12c-4b51-a8ca-7ecec1c89dc1%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/0a24f43c-9529-4d12-a380-babd39bc78e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread Steve Saner

On 09/05/2017 10:33 AM, Ash Powell wrote:
I'm not sure that this would work for us as we might have multiple 
people using/running the same role so it would need to be a common 
location (ie not a home folder)


In my case I really only have one or two people that would be running 
ansible, but I have things set up on a role account, so that anyone that 
needs to would log into the same account.


Another option, I suppose, would be to include a Makefile or something 
that "installs" your roles from the git repo to /etc/ansible.


But really, there wouldn't be anything fundamentally wrong with 
/etc/ansible/roles itself being a git repository, probably.


Steve

--
--
Steven Saner  KD0IJP
Andover, Kansas USA

--
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/f6ff981a-f8e0-3470-d884-f146aad893fc%40saner.net.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] "attr: i" failing on cent/rhel/oel6 -- why?

2017-09-05 Thread John Harmon
I am setting the immutable flag on a file (using template module).  It sets 
the immutable flag fine on cent/rhel7, but on cent/rhel/oel6 it complains.  
I can set it manually on the *6 boxes just fine.  Wondering why you think 
this may be failing.  Seems like a bug with ansible to me:

ok: [ansibletest-rhel7]
fatal: [ansibletest-rhel6]: FAILED! => 
{"changed": false, "details": "Error while setting attributes: 
/usr/bin/chattr: Clearing extent flag not supported on 
/etc/resolv.conf\n", "failed": true, "gid": 0, "group": "root", "mode": 
"0644", "msg": "chattr failed", "owner": "root", "path": 
"/etc/resolv.conf", "size": 90, "state": "file", "uid": 0}
...ignoring
fatal:
 [ansibletest-oel6]: FAILED! => {"changed": false, "details": "Error 
while setting attributes: /etc/resolv.conf: Operation not supported\n", 
"failed": true, "gid": 0, "group": "root", "mode": "0644", "msg": 
"chattr failed", "owner": "root", "path": "/etc/resolv.conf", "size": 
90, "state": "file", "uid": 0}
...ignoring
ok: [cent7]
fatal: 
[rhel6]: FAILED! => {"changed": false, "details": "Error while 
setting attributes: /usr/bin/chattr: Clearing extent flag not supported 
on /etc/resolv.conf\n", "failed": true, "gid": 0, "group": "root", 
"mode": "0644", "msg": "chattr failed", "owner": "root", "path": 
"/etc/resolv.conf", "secontext": "system_u:object_r:net_conf_t:s0", 
"size": 90, "state": "file", "uid": 0}
...ignoring



-- 
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/2ff4dea5-113d-4818-a406-ff8ea833c695%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread Ash Powell
I'm not sure that this would work for us as we might have multiple people 
using/running the same role so it would need to be a common location (ie 
not a home folder)

On Tuesday, 5 September 2017 15:51:44 UTC+1, Steve Saner wrote:
>
> On 09/05/2017 09:04 AM, Ash Powell wrote: 
> > Thanks for the links. 
> > 
> > Watching the video, it mentions about storing the Playbook in a Git 
> > repo, but nothing about storing the roles in a Git repo. 
> > 
> > I'm referring to the files that (by default) sit on 
> "/etc/ansible/roles/" 
>
>
> I, personally, don't store anything under /etc/ansible (other than 
> /etc/ansible/ansible.cfg). 
>
> I have a directory in my user home that has the following structure: 
>
> ansible/ 
>- group_vars/ 
>- hsot_vars/ 
>- library/ 
>- roles/ 
>- inventory 
>- playlist1.yml 
>- playlist2.yml 
>... 
>
> This whole directory is a git repository and I cd to that directory 
> before running ansible-playbook. 
>
> So, just like you are suggesting, I can work on the roles or libraries 
> or playlists on a develeopment machine (my workstation) and then I can 
> push the repo and pull it down on the production server from which 
> ansible is normally run. 
>
> I don't know that this is the best way, but it certainly works. 
>
> Steve 
>
> -- 
> -- 
> Steven Saner  KD0IJP 
> Andover, Kansas USA 
>

-- 
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/51b3b25f-e255-4eae-9051-1e19479ff816%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread Steve Saner

On 09/05/2017 09:04 AM, Ash Powell wrote:

Thanks for the links.

Watching the video, it mentions about storing the Playbook in a Git 
repo, but nothing about storing the roles in a Git repo.


I'm referring to the files that (by default) sit on "/etc/ansible/roles/"



I, personally, don't store anything under /etc/ansible (other than 
/etc/ansible/ansible.cfg).


I have a directory in my user home that has the following structure:

ansible/
  - group_vars/
  - hsot_vars/
  - library/
  - roles/
  - inventory
  - playlist1.yml
  - playlist2.yml
  ...

This whole directory is a git repository and I cd to that directory 
before running ansible-playbook.


So, just like you are suggesting, I can work on the roles or libraries 
or playlists on a develeopment machine (my workstation) and then I can 
push the repo and pull it down on the production server from which 
ansible is normally run.


I don't know that this is the best way, but it certainly works.

Steve

--
--
Steven Saner  KD0IJP
Andover, Kansas USA

--
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/17c21abd-4b3b-4e60-4a75-033ba6575637%40saner.net.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread Ash Powell
Thanks for the links.

Watching the video, it mentions about storing the Playbook in a Git repo, 
but nothing about storing the roles in a Git repo.

I'm referring to the files that (by default) sit on "/etc/ansible/roles/"

-- 
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/bd5e19ab-7d25-4b6f-8b3a-0160c0d91fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Task execution only for special items within a loop

2017-09-05 Thread 'J Hawkesworth' via Ansible Project
I am not sure I have fully understood your example but if the goal is to 
install someArtifact and a corresponding someArtifact-properties, but also 
allow for there not to be a someArtifact-properties, (in which case you 
would just install 'someArtifact', then you might be able to make use of 
default(omit) syntax - see the example here: 
 
http://docs.ansible.com/ansible/latest/playbooks_filters.html#omitting-parameters

Hope this helps,

Jon


On Tuesday, September 5, 2017 at 12:53:53 PM UTC+1, Tom Bartsch wrote:
>
> Hi there,
>
> I have the following playbook:
>
> ---
> - hosts: "{{ host }}"
>   vars:
> bundle_artifacts:
>   - artifactId: "someArtifact"
> version: "1.0.0"
> extension: "zip"
>   - artifactId: "kietmyartifact-properties"
> version: "5.0.0"
> extension: "jar"
>   - artifactId: "kiatmyartifact-properties"
> version: "5.0.0"
> extension: "jar"
>   - artifactId: "kiprmyartifact-properties"
> version: "5.0.0"
> extension: "jar"
>
>   tasks:
>   - set_fact:
>   bundle_artifacts_without_non_current_env_properties: "{{ 
> (bundle_artifacts_without_non_current_env_properties | default([])) + 
> [{'artifactId':item.artifactId, 
> 'version':item.version,'extension':item.extension}] }}"
> with_items: "{{ bundle_artifacts }}"
> when: ('"{{ product }}-properties" not in item.artifactId') or ('"{{ env 
> }}{{ product }}-properties" in item.artifactId')
>
>
>
> env is a property that depends on the host the execution is for. Values of 
> env could be: et, at, qs or pr.
> product is a property that depends on the host the execution is for too. 
> Assume the value is here: myartifact
>
>
> Now my problem is that after executing the task above 
> bundle_artifacts_without_non_current_env_properties contains the same 
> elements like bundle_artifacts.
>
> I would like to have the following artifacts in 
> bundle_artifacts_without_non_current_env_properties if product was 
> "myartifact" and env was "at":
>
> someArtifact and kiatmyartifact-properties.
>
> The artifacts kietmyartifact-properties and kiprmyartifact-properties should 
> be ignored.
>
>
> Does anybody know what I have to do to get this work?
>
> Regards,
> Tom
>
>

-- 
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/09e06a6f-be8a-49b0-95c0-9c307a6c34df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: install help from source

2017-09-05 Thread Soniya panwar
>>I can't seem to find out the exact process of installing it in a 
different path other then /usr/local/bin (I guess it is the default? ) 

yes, you can install this from different path. you can give the directory 
path while cloning the code. you can follow these steps:

step:1 yum install make git make gcc python-devel libffi-devel 
openssl-devel epel-release python-sphinx
step:2 yum install python-pip
step:3 git clone git://github.com/ansible/ansible.git 
step:4 cd 
step:5 git branch -a | grep stable
step:6 git checkout stable-2.3 
step:7 make
step:8 make install
step:9 yum install epel-release

and after completing these steps you can check your ansible version:
$ ansible --version




On Thursday, July 27, 2017 at 12:17:43 PM UTC+5:30, Imam Toufique wrote:
>
> Hi, 
>
> I am new to Ansible.  I am looking into using ansible, but I don't want to 
> install this from rpm or deb packages. I was trying to install from source, 
> but I can't seem to find out the exact process of installing it in a 
> different path other then /usr/local/bin (I guess it is the default? ) .  
>
> is there any documentation on how to install this from source?  i found 
> this link 
> http://docs.ansible.com/ansible/latest/intro_installation.html#running-from-source
>  
> , but it does not explain how to install the tool in a different location 
> other then /usr/bin or /usr/local/bin.
>
> i downloaded the latest bits from the release area.  
>
> Any help would be very much appreciated! 
>
> 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/d83f5421-26d6-4f80-8153-dfaf1f7bf513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] vmware_guest module configure networks with distributed switch / Portgroup

2017-09-05 Thread 'Jörg Mainzer' via Ansible Project
Hello,

on creation or reconfiguration of a vmware guest I got an error:
fatal: [localhost]: FAILED! => {"changed": true, "failed": true, "msg": 
"Das Objekt oder Element, auf das Bezug genommen wurde, konnte nicht 
gefunden werden."}

when the network is a Portgroup of a  vSphere distributed switch.

Using a standard switch network is ok.

The vsphere_guest module has the option to specify the network_type, like:
  network_type: dvs
So with the vsphere module I can create the network, but with the 
vmware_guest module I am stuck.

Is the vmware_guest module not supporting dvs?

Joerg

-- 
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/9eed1b33-d3c5-4d72-8f28-463f5ae9dd98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible API run playbook on specific tasks using tags

2017-09-05 Thread Anonymous
HI,

It would be great if someone can help me to specify tags while running 
ansible playbook via Ansible API 2.0.

I have below code taken 
from 
https://stackoverflow.com/questions/27590039/running-ansible-playbook-using-python-api:

#!/usr/bin/env python
import osimport sysfrom collections import namedtuple
from ansible.parsing.dataloader import DataLoaderfrom ansible.vars import 
VariableManagerfrom ansible.inventory import Inventoryfrom 
ansible.executor.playbook_executor import PlaybookExecutor

variable_manager = VariableManager()
loader = DataLoader()

inventory = Inventory(loader=loader, variable_manager=variable_manager,  
host_list='/ansible/hosts')
playbook_path = '/ansible/ls.yml'
if not os.path.exists(playbook_path):
print '[INFO] The playbook does not exist'
sys.exit()
Options = namedtuple('Options', ['listtags', 'listtasks', 'listhosts', 
'syntax', 'connection','module_path', 'forks', 'remote_user', 
'private_key_file', 'ssh_common_args', 'ssh_extra_args', 'sftp_extra_args', 
'scp_extra_args', 'become', 'become_method', 'become_user', 'verbosity', 
'check'])
options = Options(listtags=False, listtasks=False, listhosts=False, 
syntax=False, connection='ssh', module_path=None, forks=100, 
remote_user='slotlocker', private_key_file=None, ssh_common_args=None, 
ssh_extra_args=None, sftp_extra_args=None, scp_extra_args=None, become=True, 
become_method=None, become_user='root', verbosity=None, check=False)

variable_manager.extra_vars = {'hosts': 'mywebserver'} # This can accomodate 
various other command line arguments.`

passwords = {}

pbex = PlaybookExecutor(playbooks=[playbook_path], inventory=inventory, 
variable_manager=variable_manager, loader=loader, options=options, 
passwords=passwords)

results = pbex.run()


Using above code I can achieve below:

ansible-playbook ls.yml -i hosts --extra-vars "hosts=mywebserver"


However I want to specify tags and achieve it using Ansible API 2.0:

ansible-playbook ls.yml -i hosts --extra-vars "hosts=mywebserver" --tags 
"TestCopy"



Thanks,

Anonymous



-- 
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/8949bdea-a8d0-462a-8007-6a59da8c6a45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Task execution only for special items within a loop

2017-09-05 Thread 'Tom Bartsch' via Ansible Project
Hi there,

I have the following playbook:

---
- hosts: "{{ host }}"
  vars:
bundle_artifacts:
  - artifactId: "someArtifact"
version: "1.0.0"
extension: "zip"
  - artifactId: "kietmyartifact-properties"
version: "5.0.0"
extension: "jar"
  - artifactId: "kiatmyartifact-properties"
version: "5.0.0"
extension: "jar"
  - artifactId: "kiprmyartifact-properties"
version: "5.0.0"
extension: "jar"

  tasks:
  - set_fact:
  bundle_artifacts_without_non_current_env_properties: "{{ 
(bundle_artifacts_without_non_current_env_properties | default([])) + 
[{'artifactId':item.artifactId, 
'version':item.version,'extension':item.extension}] }}"
with_items: "{{ bundle_artifacts }}"
when: ('"{{ product }}-properties" not in item.artifactId') or ('"{{ env 
}}{{ product }}-properties" in item.artifactId')



env is a property that depends on the host the execution is for. Values of env 
could be: et, at, qs or pr.
product is a property that depends on the host the execution is for too. Assume 
the value is here: myartifact


Now my problem is that after executing the task above 
bundle_artifacts_without_non_current_env_properties contains the same elements 
like bundle_artifacts.

I would like to have the following artifacts in 
bundle_artifacts_without_non_current_env_properties if product was "myartifact" 
and env was "at":

someArtifact and kiatmyartifact-properties.

The artifacts kietmyartifact-properties and kiprmyartifact-properties should be 
ignored.


Does anybody know what I have to do to get this work?

Regards,
Tom

-- 
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/a3412494-2ab0-497a-be17-884c3681f017%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Building an ini file based on user input

2017-09-05 Thread chipcha
Hi Adrian,
Thanks for your response!

see my comments inline

On Monday, August 14, 2017 at 7:43:21 PM UTC+3, Adrian Likins wrote:
>
>
>
> The default ansible inventory format is only 'ini-like' so I wouldn't 
> expect tools for handling standard ini files (like the ini_file module) to 
> work well.
> The examples you mention are good examples of where that falls apart.
>
>
> Haven't ran the examples or dug in yet, but first thought is it looks like 
> this is implementing what inventory and the 'hosts:' keyword does.
>
> I would try a more standard approach first, notes later...
>
> As far as generating a inventory with ansible tasks... That smells like 
> the wrong approach to me. 
>
> inventory ini file looks a little odd to me. Having a group and a host 
> with the same name is confusing (data_storage)
> Is 'data_storage_ver2' a valid resolveable hostname? if not, need to 
> provide a value for ansible_host
>

You are right, it is confusing, I changed the alias name to a different 
name.
'data_storage_ver2' is the applicative storage name that I use to add it to 
my setup.
It isn't the host name, I use the ip of it to connect to it with mount 
command.

 

>
>
>
> # main playbook 
> - include: library/add_NFS_domain.yml storage={{ item }}
>   with_inventory_hostnames: storage
>
>
> (why is the yaml file in library/ ? library is usually for per playbook 
> ansible modules)
>


I changed my code to work roles.
Thanks.
 

> Where does ovirt_hosts come from?
>

ovirt_hosts is a variable initialized in ovirt_hosts_facts.


> try roughly:
>
>
> # storage.ini (inventory)
>
> data_storage storage_domain_name=name1 address1=12.12.12.12 
> path1=data_storage dc_name=DC1
> data_storage_ver2 storage_domain_name=name2 address1=12.12.12.13 
> path1=data_storage2 dc_name=DC2
>

> [storage]
> data_storage
> data_storage_ver2
>

I gave it a try, seems to do the trick. Thanks!!! 

>
> # main playbook assuming ovirt_hosts and ovirt_auth is defined somewhere...
>
> - name: ensure ovirt storage domains for each host
>   # apply to hosts in the 'storage' group
>   hosts: storage
> - tasks:
>
>   - ovirt_hosts_facts:
>   pattern: "status=up and datacenter={{ dc_name }}"
>   auth: "{{ ovirt_auth }}"
>
>   - ovirt_storage_domains:
>   name: "{{ storage_domain_name }}"
>   host: "{{ ovirt_hosts[0].name }}"
>   data_center: "{{ dc_name }}"
>   auth: "{{ ovirt_auth }}"
>   nfs:
> address: "{{ ip1 }}"
> path: "{{ path1 }}"
>
> On Sun, Aug 13, 2017 at 5:21 PM, chipcha  > wrote:
>
>> Hi all,
>>
>
>
>  
>
>> Here are few examples of the differences between the two:
>> 1. ini_file module - When adding a value with ini_file module the syntax 
>> must always be [key]=[value] even if there is no value:
>> [webservers]
>> foo=foo.example.com
>> bar=None
>>
>> ansible docs - In the docs the ini file uses standalone names, so we can 
>> have a group with only hostnames, for example:
>> [webservers]
>> foo.example.com
>> bar.example.com
>>
>> 2. ini_file module - It is not possible to declare host variables in a 
>> one liner:
>> [atlanta]
>> http_port=80
>> maxRequestsPerChild=808
>>
>> ansible docs:
>> [atlanta]
>> host1 http_port=80 maxRequestsPerChild=808
>>
>> Also it seems that the ini_file module does not support reading from the 
>> ini file only insert or update.
>>
>> What do you recommend for the best approach? is there any other ansible 
>> module I can use to manipulate data in my INI file or should I use a 
>> different approach? 
>>
>> Here is an example of my ini file:
>> # INI file
>> [data_storage]
>> data_storage name=name1 address1=12.12.12.12 path1=data_storage dc_name=
>> DC1
>>
>>
>> [data_storage_ver2]
>> data_storage_ver2 name=name2 address1=12.12.12.13 path1=data_storage2 
>> dc_name=DC2
>>
>>
>> [storage:children]
>> data_storage
>> data_storage_ver2
>>
>>
>> The playbook looks like this:
>> # main playbook 
>> 
>> 
>> - include: library/add_NFS_domain.yml storage={{ item }}
>>   with_inventory_hostnames: storage
>> 
>>
>>
>> # task file
>> - ovirt_hosts_facts:
>>pattern: "status=up and datacenter={{ hostvars[storage]['dc_name'] }}"
>>auth: "{{ ovirt_auth }}"
>>
>>
>> - ovirt_storage_domains:
>> name: "{{ hostvars[storage]['name'] }}"
>> host: "{{ ovirt_hosts[0].name }}"
>> data_center: "{{ hostvars[storage]['dc_name'] }}"
>> auth: "{{ ovirt_auth }}"
>> nfs:
>> address: "{{ hostvars[storage]['ip1'] }}"
>> path: "{{ hostvars[storage]['path1'] }}"
>>
>>
>>
>> -- 
>> 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 
>> 

Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread 'J Hawkesworth' via Ansible Project
Probably lots of 'correct' ways of setting this up, but if you want a 
suggestion of how to start, this is something that Sam Doran talked about 
in his Ansiblefest London talk earlier this year.  The video is 
here: https://www.youtube.com/watch?v=7gEKmsuJr7s=youtu.be

(other interesting presentations 
here: https://www.ansible.com/videos-ansiblefest-london-2017 , by the way).

Hope this helps,

Jon


On Tuesday, September 5, 2017 at 8:27:50 AM UTC+1, Ash Powell wrote:
>
> Fantastic!
>
> Are there any guides or walkthroughs showing the best/correct way of 
> setting this up?
>
> Like I say, I’ve had a search myself but there’s nothing specific that I 
> can find.
>
> On Monday, 4 September 2017 17:46:59 UTC+1, Dick Visser wrote:
>>
>> That's not only possible but highly reconmended as well.
>> Especially if they're subject to change - i think most people here use 
>> roles that are.
>>
>> Dick 
>>
>> On Mon, 4 Sep 2017 at 17:48, Ash Powell  wrote:
>>
>>> This may be a silly question, but I've searched around and can't find 
>>> anyone asking a similar thing.
>>>
>>> Is it possible for Ansible roles to be stored in a source control 
>>> repository (such as Git)?
>>>
>>> Scenario;
>>>
>>> We have an ansible server and currently, all of our roles are stored in 
>>> /etc/ansible/roles
>>> If we want to make a change to a role we ssh onto the ansible server and 
>>> manually edit the file (such as tasks/main.yml)
>>>
>>> Is there a way that we can have these files stored in source control so 
>>> that I can edit the file from my local machine, push into a repo and then 
>>> ansible pulls the files before running the playbook/role?
>>> I know we can store files in a repo and call these files DURING a job 
>>> run, but I want to store the roles themselves in there...
>>>
>>> -- 
>>> 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/5b4a66be-8d23-43c0-a5b8-7df8010e4412%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> Dick Visser
>> 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/9f30f83d-e925-4f02-8e48-fb5b25e97f6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Structuring and managing multiple unrelated projects

2017-09-05 Thread 'J Hawkesworth' via Ansible Project
I think the hosts would get merged into a single group called web, so that 
in itself might not be a problem.  
Where you might fall down is if you have different group var settings for 
hosts belonging to the same group names.

If that's the case you might be able to move things around a little or 
perhaps have a different group_vars file in the dir that just contains 
common settings across your hosts.



On Monday, September 4, 2017 at 2:17:09 PM UTC+1, jamiepau...@gmail.com 
wrote:
>
> Yeah, I think I'd need to create symlinks to all the group_vars too. 
> Actually, I'm not too sure how it could work because each inventory file 
> looks like this:
>
> [web]
> somehost
>
> [web]
> some_other_host
>
> On Monday, 4 September 2017 14:00:34 UTC+1, J Hawkesworth wrote:
>>
>> You could just keep your individual inventories for each client but then 
>> use a directory containing symlinks to all the client inventory files.
>>
>> I use this trick as I have 2 environments that run inside the same 
>> physical datacenter.  Mostly I want to make changes to just one environment 
>> at a time, but for stuff like patching it makes sense to hit all the hosts 
>> in the datacenter.
>>
>> Only slight downside is if you use group_vars then you have to symlink to 
>> the group_vars as well.
>>
>> Jon
>>
>>
>> On Sunday, September 3, 2017 at 11:40:30 PM UTC+1, jamiepau...@gmail.com 
>> wrote:
>>>
>>> They are at the moment at least webservers each hosting a project or 
>>> group of projects relating to a particular client. It makes resource 
>>> allocation and billing easier. It affords us the facility to throw hardware 
>>> resources or scale up a client's needs. But although each server is 
>>> essentially a LAMP stack, some use different software or have different 
>>> requirements and would need a playbook of their own.
>>>
>>> Managing all projects, their webservers, future additional servers and 
>>> DB servers etc, plus prod/staging/testing versions in one inventory isn't 
>>> ideal either.
>>>
>>

-- 
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/8cf362f3-aab7-4f5a-8905-23ecf46debfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Commands needed for NPM Set registry, NPM set proxy and untar a tgz file in ansible

2017-09-05 Thread ManiGandan T
Hi Team,

I am logically creating a code in ansible-container with reference of a 
nodejs application container code written using docker. I am not able to 
find the exact syntax to change the below docker code. Could someone help 
me on this.

RUN npm config set registry http://registry.npmjs.org/ - Set npm
RUN npm config set proxy http://prod-proxy-out..com:8080 - set proxy 
using npm
 RUN tar -xzf *.tgz - untar a existing tar file

I tried these options, but they are not working

Approach 1:
 shell: npm config set registry "{{ nodejs_npm_registry }}"
 when: nodejs_npm_registry != "https://registry.npmjs.org/;
Approach 2;
- name: Set NPM registry
  command: 'npm config set registry http://registry.npmjs.org/'

Approach used for Untar:
 unarchive:
src: "{{ node_package_url }}"
dest: "{{ app_home_path  }}"
copy: no
mode: 0777

None of the above is working. please guide me with proper steps so that i 
can proceed and run the code by changing the docker file syntax.

TIA!

-- 
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/d6580456-1fe0-4621-b5f5-f46b6b621ed4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Python API 2.0 Ansible Fail

2017-09-05 Thread TranceWorldLogic
Hi,

I was trying to invoke ansible plabook from python and got various blocker. 
1> I have used dict formated data for ansible playbook tasks. And then 
tried to executed it working fine (as shown example in below link)
e.g. at http://docs.ansible.com/ansible/latest/dev_guide/developing_api.html

But I want to use module as "shell" now got a dead end how to provide 
argument to module as free-form text.
Would you please help me with example ? (using dict as shown in example)

2> I observe than python ansible module/library fail to load inventory from 
file. (It not even parsing that file).
I think this is bug as like ymal is not handled. (Inventory INI file is not 
handled in python-anisble module/library)

Please help me to understand more about ansible library/module in python.

Thanks,
~Rohit

-- 
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/822b1692-b756-4586-8ddf-c0c3c723c01e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible roles stored in Git

2017-09-05 Thread Ash Powell


Fantastic!

Are there any guides or walkthroughs showing the best/correct way of 
setting this up?

Like I say, I’ve had a search myself but there’s nothing specific that I 
can find.

On Monday, 4 September 2017 17:46:59 UTC+1, Dick Visser wrote:
>
> That's not only possible but highly reconmended as well.
> Especially if they're subject to change - i think most people here use 
> roles that are.
>
> Dick 
>
> On Mon, 4 Sep 2017 at 17:48, Ash Powell  
> wrote:
>
>> This may be a silly question, but I've searched around and can't find 
>> anyone asking a similar thing.
>>
>> Is it possible for Ansible roles to be stored in a source control 
>> repository (such as Git)?
>>
>> Scenario;
>>
>> We have an ansible server and currently, all of our roles are stored in 
>> /etc/ansible/roles
>> If we want to make a change to a role we ssh onto the ansible server and 
>> manually edit the file (such as tasks/main.yml)
>>
>> Is there a way that we can have these files stored in source control so 
>> that I can edit the file from my local machine, push into a repo and then 
>> ansible pulls the files before running the playbook/role?
>> I know we can store files in a repo and call these files DURING a job 
>> run, but I want to store the roles themselves in there...
>>
>> -- 
>> 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/5b4a66be-8d23-43c0-a5b8-7df8010e4412%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Dick Visser
> 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/ea49f259-9bc2-4706-87ce-06a34144d2f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.