[ansible-project] django_manage with custom django manage commands.

2015-12-03 Thread anoop . kolari
Does ansible 1.7.1 supports execution of custom django manage commands with 
ansible django_manage module?

-- 
 =
DISCLAIMER: The information in this message is confidential and may be 
legally privileged. It is intended solely for the addressee. Access to this 
message by anyone else is unauthorized. If you are not the intended 
recipient, any disclosure, copying, or distribution of the message, or any 
action or omission taken by you in reliance on it, is prohibited and may be 
unlawful. Please immediately contact the sender if you have received this 
message in error. Further, this e-mail may contain viruses and all 
reasonable precaution to minimize the risk arising there from is taken by 
Tarams. Tarams is not liable for any damage sustained by you as a result of 
any virus in this e-mail. All applicable virus checks should be carried out 
by you before opening this e-mail or any attachment thereto.
Thank you - Tarams Software Technologies Pvt.Ltd.
=

-- 
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/f4cd8b35-4c98-4429-8723-7fde33f60d6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible createsuperuser with django_manage module.

2015-12-03 Thread anoop . kolari
Thanks Chris.

Instead of the solution you have suggested, I'm tried to create a custom 
django manage command. But when i invoked this from ansible through 
django_manage, its throws an error like the one below.

fatal: [djangoskeleton-local.com] => failed to parse: 
SUDO-SUCCESS-wzpnssbmxbwqvxmfgljczjecbynjytor
Traceback (most recent call last):
  File 
"/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage",
 
line 1627, in 
main()
  File 
"/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage",
 
line 228, in main
if value and param not in command_allowed_param_map[command]:
KeyError: 'change_django_admin_password --username=admin 
--password=tarams123'


FATAL: all hosts have already failed -- aborting

This command works fine when I tried from python manage.py shell.

Could you please suggest. 

On Thursday, December 3, 2015 at 10:35:52 AM UTC+5:30, anoop@tarams.com 
wrote:
>
> Hi,
>
> I'm creating a super user for my django application through ansible. 
> Script is below.
>
> django_manage: command="createsuperuser --noinput --username=admin --email=
> anoop.kol...@tarams.com" app_path={{ django_dir }} 
> settings={{settings_path}}
>
> Its creating the super user with some random password. Please let me know 
> the following at the earliest.
>
>
> 1) Is it possible to set password with the command?
> 2) Whats the default password its setting when executing that command?
>
>  =
> DISCLAIMER: The information in this message is confidential and may be 
> legally privileged. It is intended solely for the addressee. Access to this 
> message by anyone else is unauthorized. If you are not the intended 
> recipient, any disclosure, copying, or distribution of the message, or any 
> action or omission taken by you in reliance on it, is prohibited and may be 
> unlawful. Please immediately contact the sender if you have received this 
> message in error. Further, this e-mail may contain viruses and all 
> reasonable precaution to minimize the risk arising there from is taken by 
> Tarams. Tarams is not liable for any damage sustained by you as a result of 
> any virus in this e-mail. All applicable virus checks should be carried out 
> by you before opening this e-mail or any attachment thereto.
> Thank you - Tarams Software Technologies Pvt.Ltd.
> =
>

-- 
 =
DISCLAIMER: The information in this message is confidential and may be 
legally privileged. It is intended solely for the addressee. Access to this 
message by anyone else is unauthorized. If you are not the intended 
recipient, any disclosure, copying, or distribution of the message, or any 
action or omission taken by you in reliance on it, is prohibited and may be 
unlawful. Please immediately contact the sender if you have received this 
message in error. Further, this e-mail may contain viruses and all 
reasonable precaution to minimize the risk arising there from is taken by 
Tarams. Tarams is not liable for any damage sustained by you as a result of 
any virus in this e-mail. All applicable virus checks should be carried out 
by you before opening this e-mail or any attachment thereto.
Thank you - Tarams Software Technologies Pvt.Ltd.
=

-- 
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/dc941069-a059-408e-a3ca-47c78730d8da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] how to abort ansible execution in callback

2015-12-03 Thread Leon Xie
hi all,

I want to abort entire ansible execution in a callback file.
how could I implement that?

The below code doesn't work:

def runner_on_failed(self, host, res, ignore_errors=False):
 sys.exit(1)

thanks a lot 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/3d033449-bb0c-47e3-9255-87c6d8fa7ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Expand group_name in a loop with_items

2015-12-03 Thread Manuel Jiménez
Hello, 
I need to expand the group_name for each host in the iteration because I 
would like to have different folders for each group.

So if the playbook is doing frontend1 I wan't to access to frontends 
templates

Example:

Inventory
[frontend1]
1.2.3.4

[frontend2]
1.2.3.5

[backend1]
2.3.4.5

[backend2]
2.3.4.6

[backends:children]
backend1
backend2

[frontends:children]
frontend1
frontend2


Templates directory inside role

roles/
roles/cron/
roles/cron/backends/
roles/cron/backends/test_cron.j2
roles/cron/frontends/
roles/cron/frontends/test_cron.j2

TASK
- template: src={{ item.src }} dest={{ item.dest }}
with_items:
  - { src: 'templates/cron/{{ ansible_groupname }}/test_cron.j2', dest: 
'/etc/cron.d/crawlers' }

But it doesn't work. I don't know what variable should I use there...

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/30a43855-2c92-49c0-881d-44567a6c763a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] unarchive fails?!

2015-12-03 Thread Christian Schmitt
Hello, currently I try to unarchive a file via ansible however I always get 
the following:

msg: Failed to find handler to unarchive. Make sure the required command to 
extract the file is installed.


Currently my Machine is a OS X 10.11 and my Target machine a CentOS 7.

However I have another set of machines on CentOS 7 where I use tar.gz 
archives and unarchive which succeeds.

Currently tar and gunzip is installed on both machines.

-- 
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/45038ad8-11fa-4dc4-84af-922ab69f4b82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible didn't stop execution upon a task failure

2015-12-03 Thread Leon Xie
thanks a lot for your reply.

On Tuesday, December 1, 2015 at 10:22:42 AM UTC+8, Brian Coca wrote:
>
> I don't know, those options work for me.
>

-- 
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/00f80393-9554-43f2-a0e5-985112955256%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Hipchat module not compatible with hipchat API v2?

2015-12-03 Thread wanna know
Do you have an example of your hipchat playbook?

-- 
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/05652254-837d-4a7b-bb8d-5dfbb6a49be1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Get IP Address of server

2015-12-03 Thread saikrishnakhanday
Andrew Edelstein,

am trying to get only IP addr and I have used " 
ansible_default_ipv4.address " and its working. Thanks for sharing 
additional information on this.

Cheers!


On Wednesday, December 2, 2015 at 11:12:03 AM UTC-6, saikrish...@gmail.com 
wrote:
>
> Can any one please help me how can I write a script to fetch its own IP 
> Address.
>

-- 
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/a2c802e0-e322-4978-9ad8-48db2b4c3551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] pressed late_command ansibe-pull

2015-12-03 Thread Eric Keller
Hi there,

I am using foreman for setting up some Ubuntu clients, using ansible as 
configuration management. I was struggeling with preseed late_command and 
ansible-pull, that's why I would like to post about a working solution:

```
d-i preseed/late_command string \
echo 'GIT_SSL_NO_VERIFY=true /usr/bin/ansible-pull -C gitworkshop -U 
https://github.com/mylogin/ansibles.git -d /tmp/ansibles -i ./localhost 
ansible/workshop.yml' > /target/tmp/pull.sh; \
chmod +x /target/tmp/pull.sh; \
chroot /target /bin/sh /tmp/pull.sh
```

Note: GIT_SSL_NO_VERIFY can be omited in case you have all ca-certificates 
properly configured.
the localhost file contains the localhost word.

Note: this did not work with the in-target preseed keyword.

Best Regards
--
Eric

-- 
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/54032255-c463-4310-a188-302f112e8362%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Retrieve group children

2015-12-03 Thread Laurent DEVIGNES
I don't know how to retrieve simply group children

I have this structure
[group1]
foo1
foo2

[group2]
bar1
bar2

[group3]
baz1
baz2

[MetaGroupA:children]
group1
group2

[MetaGroupB:children]
group3

For some goup_vars, I just want to loop for each group of MetaGroups, but 
don't want to loop on hosts

Could you give me way to achieve this ? (with a "for" loop ?)

Regards

-- 
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/58af134d-9a7d-4bd1-bf7e-bdec7ee79715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible2.0 expect module not working

2015-12-03 Thread Toshio Kuratomi
What version of pexpect are the two of you using?

On Thu, Dec 3, 2015 at 6:52 AM, Michele Kappa  wrote:
> Exactly the same is happening over here, trying to use expect, having
> installed the pexpect package earlier in the role tasks. Here is the -
> of ansible, trying to install a gitlab ci runner:
>
> fatal: [xxx.yyy.zzz]: FAILED! => {"changed": false, "failed": true,
> "invocation": {"module_args": {"command": "gitlab-ci-multi-runner register",
> "responses": {"Please enter the gitlab-ci coordinator URL (e.g.
> https://gitlab.com/ci )": "https://gitlab.com/ci;, "Please\\ enter\\ the\\
> Docker\\ image\\ \\(eg\\. ruby\\:2\\.1\\)\\:": "ruby:2.1", "Please\\ enter\\
> the\\ executor\\:\\ shell\\,\\ docker\\,\\ docker\\-ssh\\,\\ ssh\\?":
> "docker", "Please\\ enter\\ the\\ gitlab\\-ci\\ description\\ for\\ this\\
> runner": "my-runner", "Please\\ enter\\ the\\ gitlab\\-ci\\ token\\ for\\
> this\\ runner": "xx"}}, "module_name": "expect"}, "msg":
> "Traceback (most recent call last):\r\n  File
> \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\",
> line 2084, in \r\nmain()\r\n  File
> \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\",
> line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout,
> withexitstatus=True,\r\nAttributeError: 'module' object has no attribute
> 'runu'\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading
> configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line
> 56: Applying options for *\r\ndebug1: auto-mux: Trying existing
> master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2:
> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards:
> request forwardings: 0 local, 0 remote\r\ndebug3:
> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive:
> entering\r\ndebug3: mux_client_request_alive: done pid = 3439\r\ndebug3:
> mux_client_request_session: session request sent\r\ndebug1:
> mux_client_request_session: master session id: 2\r\ndebug3:
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received
> exit status from master 0\r\nShared connection to cremaster2.aavv.io
> closed.\r\n", "parsed": false}
>
> Any ideas?
>
> On Tuesday, 1 December 2015 17:12:25 UTC+1, Karan Singh wrote:
>>
>> Hello Guys
>>
>> Here is my ansible task
>>
>>  - name: Firmware path lookup
>>shell: rpm -ql hp-firmware-"{{ device.stdout }}" | grep '\.scexe'
>>register: FirmwarePath
>>
>>  - expect:
>>  command: sh "{{ FirmwarePath.stdout }}"
>>  responses:
>>"Continue (y/N)": 'y'
>>
>>
>> And it ends up like this.
>>
>> TASK [ansible-role-hp-firmware-upgrade : expect command=sh "{{
>> FirmwarePath.stdout }}" responses={u'Continue (y/N)': u'y'}] ***
>> fatal: [storage0204]: FAILED! => {"changed": false, "failed": true, "msg":
>> "Traceback (most recent call last):\r\n  File
>> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
>> line 2084, in \r\nmain()\r\n  File
>> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
>> line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout,
>> withexitstatus=True,\r\nAttributeError: 'module' object has no attribute
>> 'runu'\r\n", "parsed": false}
>>
>> If i run this manually with script command it works nicely.
>> Can you please advice , how can i make this work.
>>
>> - Karan -
>>
>>
>>
>>
> --
> 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/0fc45997-057b-4286-9d89-e65fdb133ec1%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/CAG9juEotQaJDMn2EjbbZfXBwJ1zdZRbwVonH79LqUaD_zJXQsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Expand group_name in a loop with_items

2015-12-03 Thread Manuel Jimenez
Fixed with:

  - ../templates/cron/{{ group_names[1] }}/test_cron.j2 


2015-12-03 12:57 GMT+01:00 Manuel Jiménez :

> Hello,
> I need to expand the group_name for each host in the iteration because I
> would like to have different folders for each group.
>
> So if the playbook is doing frontend1 I wan't to access to frontends
> templates
>
> Example:
>
> Inventory
> [frontend1]
> 1.2.3.4
>
> [frontend2]
> 1.2.3.5
>
> [backend1]
> 2.3.4.5
>
> [backend2]
> 2.3.4.6
>
> [backends:children]
> backend1
> backend2
>
> [frontends:children]
> frontend1
> frontend2
>
>
> Templates directory inside role
>
> roles/
> roles/cron/
> roles/cron/backends/
> roles/cron/backends/test_cron.j2
> roles/cron/frontends/
> roles/cron/frontends/test_cron.j2
>
> TASK
> - template: src={{ item.src }} dest={{ item.dest }}
> with_items:
>   - { src: 'templates/cron/{{ ansible_groupname }}/test_cron.j2',
> dest: '/etc/cron.d/crawlers' }
>
> But it doesn't work. I don't know what variable should I use there...
>
> Thanks!
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/xUMQXMgaGk8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/30a43855-2c92-49c0-881d-44567a6c763a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Manuel Jiménez
http://mjimenez.net

-- 
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/CAD2_Pmvib%3Dp-2U44YgftjAZ3Nhry2ekfqnwokYq0%3Dnw1AD_3zA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: checking java process

2015-12-03 Thread rup
We did it like this:

- name: Check for previous running Wildfly instances
  shell: ps -ef | grep jboss | grep java | grep -v activemq | grep -v 
/bin/sh | grep -v grep | awk '{print $2}'
  register: ps_result

- debug: msg="{{ps_result.stdout}}"
- debug: msg="{{ps_result.stderr}}"


We are also running activemq which uses java processes, so we have to 
exclude that from our grep results.

-- 
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/15e22a28-4d6c-4a4e-9680-9b35ea9b64fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Reusing a set of taks across many roles

2015-12-03 Thread rup
Where would you "store" such a file?  At what point in your directory 
structure?

On Saturday, November 21, 2015 at 11:01:49 AM UTC-7, Markus Ellers wrote:
>
> hi,
>
> you could put these tasks in a separate yml file and include this file 
> whereever you need it.
>

-- 
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/b2266158-45c5-4a0c-8fcb-026c358e045f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] unarchive fails?!

2015-12-03 Thread Toshio Kuratomi
Bit more information like what ansible version you're using and
information about the archive you're operating on would be helpful.
Here's some troubleshooting that might be helpful:


* Ansible first looks for a gtar program and then a tar program in the
user's path.  On centos7, I imagine htose would both be present so
that shouldn't be the issue.
* Ansible runs the following command to test if tar can handle the file:
   tar -tzf "FILENAME"
  Does that command work on the archive you are operating on on the
target machine?
* Is the archive the same on the centos7 machine which succeeds and
the centos7 machine that fails?

-Toshio

On Thu, Dec 3, 2015 at 3:28 AM, Christian Schmitt
 wrote:
> Hello, currently I try to unarchive a file via ansible however I always get
> the following:
>
> msg: Failed to find handler to unarchive. Make sure the required command to
> extract the file is installed.
>
>
> Currently my Machine is a OS X 10.11 and my Target machine a CentOS 7.
>
> However I have another set of machines on CentOS 7 where I use tar.gz
> archives and unarchive which succeeds.
>
> Currently tar and gunzip is installed on both machines.
>
> --
> 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/45038ad8-11fa-4dc4-84af-922ab69f4b82%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/CAG9juEo5jyU9-QTPpSX1hd%3D0HJX0unf3LfnC2-uiQxCBTi0eig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible fails with deployment_type assertion

2015-12-03 Thread Suryaveer Chauhan
Hi All,

I am trying to install OpenShift Origin V3 (following this 
) using ansible 
and it fails with following error:

TASK: [openshift_facts | Ensure PyYaml is installed] 
** 
ok: [192.168.144.132] => (item=PyYAML)

TASK: [openshift_facts | Gather Cluster facts] 
 
ok: [192.168.144.132]

TASK: [openshift_repos | assert ] 
* 
failed: [192.168.144.132] => {"assertion": 
"openshift.common.deployment_type in known_openshift_deployment_types", 
"evaluated_to": false, "failed": true}

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
 
   to retry, use: --limit @/home/suryaveer/config.retry

192.168.144.132: ok=20   changed=2unreachable=0failed=1 
  
localhost  : ok=8changed=0unreachable=0failed=0 
  

*Below is my ansible host file:*

[OSEv3:children"]
masters
nodes
 
[OSEv3:vars]
ansible_ssh_user=centos
ansible_sudo=true
#ansible_ssh_user=root
 
product_type=openshift
*deployment_type=origin*
 
[masters]
192.168.144.132 openshift_public_hostname=master openshift_ip=10.0.1.163 
openshift_public_ip=192.168.144.132
 
[nodes]
192.168.144.128 openshift_public_hostname=node1 openshift_ip=10.0.1.164 
openshift_public_ip=192.168.144.128 openshift_node_labels="{'region': 
'primary', 'zone': 'east'}" 
192.168.144.129 openshift_public_hostname=node2 openshift_ip=10.0.1.165 
openshift_public_ip=192.168.144.129 openshift_node_labels="{'region': 
'primary', 'zone': 'west'}"

I found one post on github for similar error but was inconclusive.

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/0ff2ce28-d886-4d83-a838-63b417edfa40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible2.0 expect module not working

2015-12-03 Thread Karan Singh
i have updated pexpect version to 4.0.1 and it worked.

On Thu, Dec 3, 2015 at 6:19 PM, Toshio Kuratomi 
wrote:

> What version of pexpect are the two of you using?
>
> On Thu, Dec 3, 2015 at 6:52 AM, Michele Kappa 
> wrote:
> > Exactly the same is happening over here, trying to use expect, having
> > installed the pexpect package earlier in the role tasks. Here is the
> -
> > of ansible, trying to install a gitlab ci runner:
> >
> > fatal: [xxx.yyy.zzz]: FAILED! => {"changed": false, "failed": true,
> > "invocation": {"module_args": {"command": "gitlab-ci-multi-runner
> register",
> > "responses": {"Please enter the gitlab-ci coordinator URL (e.g.
> > https://gitlab.com/ci )": "https://gitlab.com/ci;, "Please\\ enter\\
> the\\
> > Docker\\ image\\ \\(eg\\. ruby\\:2\\.1\\)\\:": "ruby:2.1", "Please\\
> enter\\
> > the\\ executor\\:\\ shell\\,\\ docker\\,\\ docker\\-ssh\\,\\ ssh\\?":
> > "docker", "Please\\ enter\\ the\\ gitlab\\-ci\\ description\\ for\\
> this\\
> > runner": "my-runner", "Please\\ enter\\ the\\ gitlab\\-ci\\ token\\ for\\
> > this\\ runner": "xx"}}, "module_name": "expect"},
> "msg":
> > "Traceback (most recent call last):\r\n  File
> >
> \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\",
> > line 2084, in \r\nmain()\r\n  File
> >
> \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\",
> > line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout,
> > withexitstatus=True,\r\nAttributeError: 'module' object has no attribute
> > 'runu'\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1:
> Reading
> > configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config
> line
> > 56: Applying options for *\r\ndebug1: auto-mux: Trying existing
> > master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2:
> > mux_client_hello_exchange: master version 4\r\ndebug3:
> mux_client_forwards:
> > request forwardings: 0 local, 0 remote\r\ndebug3:
> > mux_client_request_session: entering\r\ndebug3: mux_client_request_alive:
> > entering\r\ndebug3: mux_client_request_alive: done pid = 3439\r\ndebug3:
> > mux_client_request_session: session request sent\r\ndebug1:
> > mux_client_request_session: master session id: 2\r\ndebug3:
> > mux_client_read_packet: read header failed: Broken pipe\r\ndebug2:
> Received
> > exit status from master 0\r\nShared connection to cremaster2.aavv.io
> > closed.\r\n", "parsed": false}
> >
> > Any ideas?
> >
> > On Tuesday, 1 December 2015 17:12:25 UTC+1, Karan Singh wrote:
> >>
> >> Hello Guys
> >>
> >> Here is my ansible task
> >>
> >>  - name: Firmware path lookup
> >>shell: rpm -ql hp-firmware-"{{ device.stdout }}" | grep '\.scexe'
> >>register: FirmwarePath
> >>
> >>  - expect:
> >>  command: sh "{{ FirmwarePath.stdout }}"
> >>  responses:
> >>"Continue (y/N)": 'y'
> >>
> >>
> >> And it ends up like this.
> >>
> >> TASK [ansible-role-hp-firmware-upgrade : expect command=sh "{{
> >> FirmwarePath.stdout }}" responses={u'Continue (y/N)': u'y'}] ***
> >> fatal: [storage0204]: FAILED! => {"changed": false, "failed": true,
> "msg":
> >> "Traceback (most recent call last):\r\n  File
> >>
> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
> >> line 2084, in \r\nmain()\r\n  File
> >>
> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
> >> line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout,
> >> withexitstatus=True,\r\nAttributeError: 'module' object has no attribute
> >> 'runu'\r\n", "parsed": false}
> >>
> >> If i run this manually with script command it works nicely.
> >> Can you please advice , how can i make this work.
> >>
> >> - Karan -
> >>
> >>
> >>
> >>
> > --
> > 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/0fc45997-057b-4286-9d89-e65fdb133ec1%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/ctcjL3KXYZI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAG9juEotQaJDMn2EjbbZfXBwJ1zdZRbwVonH79LqUaD_zJXQsg%40mail.gmail.com
> .
> For more options, visit 

Re: [ansible-project] pressed late_command ansibe-pull

2015-12-03 Thread Brian Coca
You could also use debconf module to deal with preseeding.

-- 
Brian Coca

-- 
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/CAJ5XC8k%2BHUbS2MwHibGwgW1kPZ9dcmTOQmWEt%3D1-yDBj5ewO-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Retrieve group children

2015-12-03 Thread Andrew Edelstein
They don't work that way.
[MetaGroupA:chldren]
group1
group2

is effectively
[MetaGroupA]
foo1
foo2
bar1
bar2

So trying to loop over MetaGroupA WILL loop over all the hosts in the child
groups.

On Thu, Dec 3, 2015 at 4:41 AM, Laurent DEVIGNES 
wrote:

> I don't know how to retrieve simply group children
>
> I have this structure
> [group1]
> foo1
> foo2
>
> [group2]
> bar1
> bar2
>
> [group3]
> baz1
> baz2
>
> [MetaGroupA:children]
> group1
> group2
>
> [MetaGroupB:children]
> group3
>
> For some goup_vars, I just want to loop for each group of MetaGroups, but
> don't want to loop on hosts
>
> Could you give me way to achieve this ? (with a "for" loop ?)
>
> Regards
>
> --
> 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/58af134d-9a7d-4bd1-bf7e-bdec7ee79715%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/CA%2BscPs6X81SuOX%3Dsq3gmstDsmN132HFHs7Z0SSc8iajAtO6_2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible2.0 expect module not working

2015-12-03 Thread Michele Kappa
Exactly the same is happening over here, trying to use expect, having 
installed the pexpect package earlier in the role tasks. Here is the - 
of ansible, trying to install a gitlab ci runner:

fatal: [xxx.yyy.zzz]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_args": {"command": "gitlab-ci-multi-runner 
register", "responses": {"Please enter the gitlab-ci coordinator URL (e.g. 
https://gitlab.com/ci )": "https://gitlab.com/ci;, "Please\\ enter\\ the\\ 
Docker\\ image\\ \\(eg\\. ruby\\:2\\.1\\)\\:": "ruby:2.1", "Please\\ 
enter\\ the\\ executor\\:\\ shell\\,\\ docker\\,\\ docker\\-ssh\\,\\ 
ssh\\?": "docker", "Please\\ enter\\ the\\ gitlab\\-ci\\ description\\ 
for\\ this\\ runner": "my-runner", "Please\\ enter\\ the\\ gitlab\\-ci\\ 
token\\ for\\ this\\ runner": "xx"}}, "module_name": 
"expect"}, "msg": "Traceback (most recent call last):\r\n  File 
\"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\", 
line 2084, in \r\nmain()\r\n  File 
\"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\", 
line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout, 
withexitstatus=True,\r\nAttributeError: 'module' object has no attribute 
'runu'\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading 
configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 
56: Applying options for *\r\ndebug1: auto-mux: Trying existing 
master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: 
mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
request forwardings: 0 local, 0 remote\r\ndebug3: 
mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
entering\r\ndebug3: mux_client_request_alive: done pid = 3439\r\ndebug3: 
mux_client_request_session: session request sent\r\ndebug1: 
mux_client_request_session: master session id: 2\r\ndebug3: 
mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
exit status from master 0\r\nShared connection to cremaster2.aavv.io 
closed.\r\n", "parsed": false}

Any ideas?

On Tuesday, 1 December 2015 17:12:25 UTC+1, Karan Singh wrote:
>
> Hello Guys
>
> Here is my ansible task
>
>  - name: Firmware path lookup
>shell: rpm -ql hp-firmware-"{{ device.stdout }}" | grep '\.scexe'
>register: FirmwarePath
>
>  - expect:
>  command: sh "{{ FirmwarePath.stdout }}"
>  responses:
>"Continue (y/N)": 'y'
>
>
> And it ends up like this. 
>
> TASK [ansible-role-hp-firmware-upgrade : expect command=sh "{{ 
> FirmwarePath.stdout }}" responses={u'Continue (y/N)': u'y'}] ***
> fatal: [storage0204]: FAILED! => {"changed": false, "failed": true, "msg": 
> "Traceback (most recent call last):\r\n  File 
> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
>  
> line 2084, in \r\nmain()\r\n  File 
> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\",
>  
> line 154, in main\r\nout, rc = pexpect.runu(args, timeout=timeout, 
> withexitstatus=True,\r\nAttributeError: 'module' object has no attribute 
> 'runu'\r\n", "parsed": false}
>
> If i run this manually with script command it works nicely.
> Can you please advice , how can i make this work.
>
> - Karan -
>
>
>
>
>

-- 
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/0fc45997-057b-4286-9d89-e65fdb133ec1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible createsuperuser with django_manage module.

2015-12-03 Thread Chris Church
This is really more of a Django issue than an Ansible one.  It's most
likely creating the user with an unusable password ("*").

There isn't a way with the built-in createsuperuser command to set a
password.  You can find one approach that addresses this problem at
http://source.mihelac.org/2009/10/23/django-avoiding-typing-password-for-superuser/
.


On Thu, Dec 3, 2015 at 12:05 AM,  wrote:

> Hi,
>
> I'm creating a super user for my django application through ansible.
> Script is below.
>
> django_manage: command="createsuperuser --noinput --username=admin --email=
> anoop.kol...@tarams.com" app_path={{ django_dir }}
> settings={{settings_path}}
>
> Its creating the super user with some random password. Please let me know
> the following at the earliest.
>
>
> 1) Is it possible to set password with the command?
> 2) Whats the default password its setting when executing that command?
>
>  =
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee. Access to this
> message by anyone else is unauthorized. If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may be
> unlawful. Please immediately contact the sender if you have received this
> message in error. Further, this e-mail may contain viruses and all
> reasonable precaution to minimize the risk arising there from is taken by
> Tarams. Tarams is not liable for any damage sustained by you as a result of
> any virus in this e-mail. All applicable virus checks should be carried out
> by you before opening this e-mail or any attachment thereto.
> Thank you - Tarams Software Technologies Pvt.Ltd.
> =
>
> --
> 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/bcbd0d27-f686-4ff2-a88d-5c1cbd8aaef6%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/CAH%2BKTJ7fAnba7TD%2B_aCHw49gpVxvUG_x2eUrRy6xRgwY6ECSfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] copy module: fail if remote file exists and is different from source?

2015-12-03 Thread Brian Coca
you could just use stat module to check the file remotely (you would
also get hash to compare to local file)

On Fri, Nov 27, 2015 at 1:48 PM, nusenu  wrote:
>> is there an (easy) way to make the copy module [1] fail if the remote
>> file exists and is different from the source file?
>> The goal is to
>> - not override the destination (force=no) and
>> - abort if the file exists and is different from the source.
>>
>> The fetch module [2] has a 'fail_on_missing' parameter. I would need a
>> fail_on_remotefileexists_but_different ;)
>> Currently one is left with
>> - backup=yes
>> or
>> - force=no
>> but both parameter won't help for the specific use-case.
>>
>> Anyone else had this use-case yet and made a workaround?
>
>
> My workaround procedure is [1]:
>
> 1) copy with force=no
> 2) fetch
> 3) compare files locally via shell (sha1sum)
> 4) fail if fingerprints do not match
>
> If there is a less dirty solution let me know ;)
>
>
> [1]
> https://github.com/nusenu/ansible-relayor/commit/b2462b6b8b4ed3b1351ff167c6dd5f7ed3263e7a
>
> --
> 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/5658CFB9.6040501%40openmailbox.org.
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8nzAc%2Bte6iy4CDhHCvPsKd%2BM9Ma-1JynMwhi%2BAAfnWV7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] understanding fetch module's security implications

2015-12-03 Thread nusenu
Hi,

I consider the ansible host as trusted, the target server that is
managed with ansible is considered less trusted (it might start attacks
against the ansible host).

Does ansible's security design match that threat model in general?


Given the following fetch module example:

- fetch: src={{ DataDir }}/{{ item[0] }}/{{ item[1] }}
dest={{ foo_dir }}/{{ item[0] }}/{{ item[1] }}.untrustedremotefile
flat=yes
  with_nested:
   - "{{ ansible_all_ipv4_addresses }}"
   - [ 'a', 'b' ]
 become: yes


I assume the target host trying to attack the ansible hosts can provide
arbitrary strings (i.e "../../../../")
as one of its IP addresses to trick the ansible host to write to
arbitrary locations (flat=yes) , but is it at least safe to assume that
the static strings defined in the playbook/role ('a', 'b' and file
suffix '.untrustedremotefile') can not be altered by the target server
or is the entire dest= path composed/generated remotely and transmitted
back to the ansible host and therefore considered untrusted entirely?

If static strings can not be altered by the remote (attacking) server
the remote server would only be able to override files named
a/b.untrustedremotefile in arbitrary locations but not for example
~/.ssh/authorized_keys.

Another question that came up while writing this email:
Is 'become: yes' in the fetch context limited to the target server or
will ansible try to escalate its privileges on the ansible host as well
(localhost)?

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/5660D2F0.1070301%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible playbook-wide variable?

2015-12-03 Thread Hristo Stoyanov
Can anyone  help :

http://stackoverflow.com/questions/33992153/ansible-playbook-wide-variable

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/011b5f39-8e5c-4089-b96c-86a006187705%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Template file location best practice?

2015-12-03 Thread Brian Coca
symlinks? submodules? both would work transparent to both devs and the
deployment.

On Thu, Dec 3, 2015 at 5:42 PM, Brian Jones  wrote:
> Where should I locate files that Ansible template steps need? My developers
> want to locate the files next to their Java code. I want the template files
> located in the Ansible source repository under the roles/name/templates
> directories. If we optimize for developers, then when I deploy, I'll need to
> checkout both the Ansible code and any git repositories containing
> templates, which seems brittle. Say I have a tomcat application and I want
> to deliver property files and config files for my application. The
> developers want these files to live next to their java code, not next to the
> Ansible code.
>
> A - Templates next to the code:
>
> app1  (developers for app1 just work here)
>+--- templates somewhere in the tree next to the java code
>
> app2  (developers for app2 just work here)
>+--- templates somewhere in the tree next to the java code
>
> Ansible
>roles
>   some-role-that-uses-templates
>references app1 files via path
>   some-other-role-that-uses-templates
>references app2 files via path
>
> RESULT:
> * Developers like where templates are
> * Deployment process does not like where templates are. All 3 repositories
> have to be checked out to deploy.
>
>
> B - Templates next to Ansible code:
>
> app1
>
> app2
>
> Ansible
>roles
>   some-role-that-uses-templates
>templates for app1 here
>   some-other-role-that-uses-templates
>templates for app2 here
>
> RESULT:
> * Developers not happy because they have to edit two locations (app# +
> Ansible), and create two commits to modify code/deployment
> * Deployment process is simplified, only checkout Ansible repository.
>
> Or is there some third better way of doing this that I'm not aware of?
>
> Brian
>
> --
> 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/ab4f494f-05fb-4ca8-ad25-916e0b88ab78%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8k4p%3D5O%2B-wJ1Dw9AA9mZ5v_-r-GdqK6mZhUSB_iGvbuOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Template file location best practice?

2015-12-03 Thread Brian Jones
Where should I locate files that Ansible template steps need? My developers 
want to locate the files next to their Java code. I want the template files 
located in the Ansible source repository under the roles/name/templates 
directories. If we optimize for developers, then when I deploy, I'll need 
to checkout both the Ansible code and any git repositories containing 
templates, which seems brittle. Say I have a tomcat application and I want 
to deliver property files and config files for my application. The 
developers want these files to live next to their java code, not next to 
the Ansible code. 

A - Templates next to the code:

app1  (developers for app1 just work here)
   +--- templates somewhere in the tree next to the java code

app2  (developers for app2 just work here)
   +--- templates somewhere in the tree next to the java code

Ansible
   roles
  some-role-that-uses-templates
   references app1 files via path
  some-other-role-that-uses-templates
   references app2 files via path

RESULT:
* Developers like where templates are
* Deployment process does not like where templates are. All 3 repositories 
have to be checked out to deploy.


B - Templates next to Ansible code:

app1

app2

Ansible
   roles
  some-role-that-uses-templates
   templates for app1 here
  some-other-role-that-uses-templates
   templates for app2 here

RESULT:
* Developers not happy because they have to edit two locations (app# + 
Ansible), and create two commits to modify code/deployment
* Deployment process is simplified, only checkout Ansible repository.

Or is there some third better way of doing this that I'm not aware of? 

Brian

-- 
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/ab4f494f-05fb-4ca8-ad25-916e0b88ab78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Template file location best practice?

2015-12-03 Thread Brian Coca
git allows you to check in symlinks and preserves them on checkout

On Thu, Dec 3, 2015 at 6:07 PM, Brian Jones  wrote:
> If we used symlinks, we would need a script to create them after checkout.
> This however would not work on windows. So symlinks won't work for us.
>
> Git submodules might be a possibility but every time I've read about them
> the resulting complexities seemed to outweigh the benefits.
>
>
> On Thursday, December 3, 2015 at 5:52:20 PM UTC-8, Brian Coca wrote:
>>
>> symlinks? submodules? both would work transparent to both devs and the
>> deployment.
>>
>> --
>> Brian Coca
>
> --
> 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/21c57e06-b361-4de6-82fb-001de5c59fca%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8n9T7GaUT0bgvxQA18ihNkWZULyn5TxTd4_jBJON-M4uA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Template file location best practice?

2015-12-03 Thread Brian Jones
If we used symlinks, we would need a script to create them after checkout. 
This however would not work on windows. So symlinks won't work for us.

Git submodules might be a possibility but every time I've read about them 
the resulting complexities seemed to outweigh the benefits. 


On Thursday, December 3, 2015 at 5:52:20 PM UTC-8, Brian Coca wrote:
>
> symlinks? submodules? both would work transparent to both devs and the 
> deployment. 
>
> -- 
> Brian Coca 
>

-- 
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/21c57e06-b361-4de6-82fb-001de5c59fca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.