Re: [ansible-project] Issue with registered variables

2016-12-08 Thread Cann
Thank you so much Matt Martz! You're awesome! 



On Thursday, December 8, 2016 at 6:08:54 PM UTC-8, Matt Martz wrote:
>
> As of Ansible 2.2 with_items does not support bare variables.
>
> As such you need to use:
>
> with_items: "{{ ec2_result.instances }}"
>
> Otherwise it will treat ec2_result.instances as a string.
>
>
> On Thu, Dec 8, 2016 at 7:08 PM Cann  wrote:
>
>> Hi guys , I am having a really hard time with *registered variables*. I 
>> banged my head around all day but could not figure this out. :(
>>
>> I simply want to register my task result as a variable and access it 
>> later on.
>>
>> This is my *debug: var=* result: https://pastebin.mozilla.org/8950629
>> and I simply want to get *dns_name*
>>
>> I call it like this:
>>
>>
>> - name: Wait for servers to boot up
>>>   wait_for:
>>> host: "{{ item.dns_name }}"
>>> port: 22
>>> delay: 30
>>> timeout: 300
>>> state: started
>>>   with_items: ec2_result.instances 
>>
>>
>>
>> But I am getting error saying that 
>>
>>
>> fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' 
>> has an invalid value, which appears to include a variable that is 
>> undefined. The error was: 'unicode object' has no attribute 'dns_name'\n\n
>>
>>
>> Can you guys please point me to right direction?
>> Thank you.
>>  
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>>
>>
>> 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/cff7dbba-13f5-449f-afb8-87c29d9e0636%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/1aa2b3c5-1a6b-4b74-b568-bef372d25811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible using versioned playbooks ala r10k

2016-12-08 Thread James Martin
Answer is to use requirements.yml:
http://docs.ansible.com/ansible/galaxy.html#id10

On Thu, Dec 8, 2016 at 1:10 PM, Vince Skahan  wrote:

> Working in a puppet shop, I have to admit r10k is pretty cool. It lets us
> set up 'versioned' environment definitions that we can apply to the right
> target computers, ala "use the development version of the puppet code
> (profile) that  configures package XYZ".All those profiles are in git,
> with versioning done via either branches (give me branch-XYZ latest) or via
> tags (give me tag v1.2.3).
>
> One discussion on serverfault was at http://serverfault.com/
> questions/788930/what-is-the-equivalent-of-r10k-in-ansible - the
> preferred answer has a very good example of what a r10k Puppetfile looks
> like, and what the ansible-galaxy equivalent would be.  The question of
> course is how to do that in vanilla ansible 'without' galaxy.
>
> Bottom line - we don't always use 'latest greatest version' of our
> automation code (puppet roles/profiles or for ansible
> roles/tasks/handlers/etc.), nor should we.  We're using the right version
> of our automation code and vars to get us the desired end state.
>
> So, we want to be able to define our environments to say configuration-ABC
> is:
>
>- these variable=values definitions (from a tag or branch of a git
>repo)
>- these roles/tasks/handlers (from a tag or branch of a git repo,
>likely one per thingy we're trying to install+configure)
>
> All without ansible-galaxy, using just ansible.  How might we make that
> happen ?
>
> Again, the link above has a great definition of how Puppet/r10k work, and
> what the galaxy equivalent would be.  I just can't afford/use galaxy at
> all.  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/990b647e-0614-4e1d-9d0f-98b6973839ea%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/CAF%3D2pTYw%2BtkT6A_9q_63c3-Xwpc5KtJCggrQAfmBjwoapcbXuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Issue with registered variables

2016-12-08 Thread Matt Martz
As of Ansible 2.2 with_items does not support bare variables.

As such you need to use:

with_items: "{{ ec2_result.instances }}"

Otherwise it will treat ec2_result.instances as a string.


On Thu, Dec 8, 2016 at 7:08 PM Cann  wrote:

> Hi guys , I am having a really hard time with *registered variables*. I
> banged my head around all day but could not figure this out. :(
>
> I simply want to register my task result as a variable and access it later
> on.
>
> This is my *debug: var=* result: https://pastebin.mozilla.org/8950629
> and I simply want to get *dns_name*
>
> I call it like this:
>
>
> - name: Wait for servers to boot up
>   wait_for:
> host: "{{ item.dns_name }}"
> port: 22
> delay: 30
> timeout: 300
> state: started
>   with_items: ec2_result.instances
>
>
>
> But I am getting error saying that
>
>
> fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args'
> has an invalid value, which appears to include a variable that is
> undefined. The error was: 'unicode object' has no attribute 'dns_name'\n\n
>
>
> Can you guys please point me to right direction?
> Thank you.
>
>
>
>
>
>
>
>
>
> --
>
>
> 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/cff7dbba-13f5-449f-afb8-87c29d9e0636%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/CAD8N0v9Yb6fdOQFLXuUN86v9JCAUYB0O9Rryz%3Do%3DUF3Omor%3Dcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Issue with registered variables

2016-12-08 Thread Cann
Hi guys , I am having a really hard time with *registered variables*. I 
banged my head around all day but could not figure this out. :(

I simply want to register my task result as a variable and access it later 
on.

This is my *debug: var=* result: https://pastebin.mozilla.org/8950629
and I simply want to get *dns_name*

I call it like this:


- name: Wait for servers to boot up
>   wait_for:
> host: "{{ item.dns_name }}"
> port: 22
> delay: 30
> timeout: 300
> state: started
>   with_items: ec2_result.instances 



But I am getting error saying that 


fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' 
has an invalid value, which appears to include a variable that is 
undefined. The error was: 'unicode object' has no attribute 'dns_name'\n\n


Can you guys please point me to right direction?
Thank you.
 

-- 
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/cff7dbba-13f5-449f-afb8-87c29d9e0636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: [ansible-devel] IMPORTANT - Ansible Repository Merge

2016-12-08 Thread tkuratomi
If you're just on ansible-project list and need more background information 
look at this mailing list thread: 
https://groups.google.com/forum/#!topic/ansible-devel/mIxqxXRsmCI

= Repomerge on repomerge, check this thread:  Update

Following the outline of a plan by willthames and a lot of  of manual 
merging by jimi-c, the repo merge has been redone and appears to work much 
better.  PRMover, and merging to ansible/ansible is now happening again.  
The update required removing the original repomerge commits and force 
pushing the corrected repository to github.  We are sorry that this causes 
a few inconveniences for users and contributors outlined below.


== How to sync your checkout against the new branch

In most cases, this should be sufficient:

$ git pull --rebase origin devel 

But in case you have any problems:
**IMPORTANT** Make sure to do step 1.  If you don't make a backup you MAY 
LOSE ANY WORK that you've done on the devel branch.
1. Clone your current devel to a new branch, ie. `git checkout devel; 
git checkout -b devel_backup`
2. Reset git to a commit prior to the repo merge: `git reset --hard 
1a4484be611bdbcaea5f14d1105b7af1ce42552a`
3. Finally, `git pull --rebase` and you should be on the most up to 
date devel,
4. cherry-pick any commits you may have had on devel_backup to the new 
devel branch.

== Re-migrating PRs

We are extremely sorry but since we had to force push to the repository the 
PRs which have already been migrated will have to be migrated again.  You 
will receive a dedicated comment on the PR with a link to instructions if 
your PR falls into this category.  We apologize profusely.

== Fixes to PRMover
* PRMover now properly checks that the user has a clone of ansible/ansible 
to migrate the PR to.   This will give them a more informative error 
message to fix the problem.
* PRMover now does a three-way diff which makes some PRs apply cleanly when 
they wouldn't apply cleanly with the default merge strategy.

== Why did we have to force push?

The original repomerge script merged the commits from the 
ansible-modues-core and ansible-modules-extras repositories by using 
read-tree to push the actual state of the modules repositories into the 
ansible/ansible repository.  The drawback of this was that trying to git 
bisect would frequently end up on commits where there was only code from 
the modules repository.  Without the ansible/ansible code, it was very hard 
to test that the commit was valid or not.  Rather than subject users trying 
to diagnose any bugs via bisect to this problem we decided that we needed 
to rewrite git history to get rid of these commits and do the merge a 
different way.

Thanks for bearing with us,
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/3a9c0013-1e45-4c69-8391-b20850a6c485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Strange lookup behavior after ansible 2.2

2016-12-08 Thread Vyacheslav
Hi,

Assuming I have lookup plugins of such form:

Single



"""
"""
from __future__ import (absolute_import, division, print_function)
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase

__metaclass__ = type


class LookupModule(LookupBase):

def run(self, terms, variables=None, **kwargs):
result="single_row"
return [result]



Multiple



"""
"""
from __future__ import (absolute_import, division, print_function)
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase

__metaclass__ = type


class LookupModule(LookupBase):

def run(self, terms, variables=None, **kwargs):
result=[ "row1", "row2"]
return [result]





Play:



  - block:

- name: Lookup 1
  set_fact:
lookup1: "{{lookup('single')}}"

- debug: var="lookup1"

- name: Lookup 2
  set_fact:
lookup2: "{{lookup('multiple')}}"

- debug: var="lookup2"

- set_fact:
previously_it_was_working: "{{lookup1[0]}}"

- set_fact:
now_only_this_working: "{{lookup2[0]}}"


- debug: msg="This debug should not be skipped 
{{previously_it_was_working}}"

- debug: msg="This debug should not be skipped too 
{{now_only_this_working}}"

- shell: "echo This might be errored but not skipped 
{{previously_it_was_working}}. And was working in Ansible 2.1"

- shell: "echo This might be errored too but definitely not skipped 
{{now_only_this_working}}}. And was working in Ansible 2.1"

- debug: msg="Nice to meet you http://github.com/voronenko;

when: 1==1





Expected result:  returned array in both cases.

Side effect:  in more complex production play actions like below now 
sometimes are just skipped?

- debug: msg="This debug should not be skipped 
{{previously_it_was_working}}"

- shell: "echo This might be errored but not skipped 
{{previously_it_was_working}}. And was working in Ansible 2.1"

Instead I have play:

===
ansible 2.2.0.0
  config file = 
  configured module search path = Default w/o overrides

PLAY [Test play] 
***

TASK [setup] 
***
ok: [localhost]

TASK [Lookup 1] 

ok: [localhost]

TASK [debug] 
***
ok: [localhost] => {
"lookup1": "single_row"
}

TASK [Lookup 2] 

ok: [localhost]

TASK [debug] 
***
ok: [localhost] => {
"lookup2": [
"row1", 
"row2"
]
}

TASK [set_fact] 

ok: [localhost]

TASK [set_fact] 

ok: [localhost]

TASK [debug] 
***
ok: [localhost] => {
"msg": "This debug should not be skipped s"
}

TASK [debug] 
***
ok: [localhost] => {
"msg": "This debug should not be skipped too row1"
}

TASK [command] 
*
changed: [localhost]

TASK [command] 
*
changed: [localhost]

TASK [debug] 
***
ok: [localhost] => {
"msg": "Nice to meet you http://github.com/voronenko;
}

PLAY RECAP 
*
localhost  : ok=12   changed=2unreachable=0failed=0 
 


-- 
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/c336ce47-a88e-4ab9-98f9-b3e64153aa68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Oracle 12c Install from Ansible Script

2016-12-08 Thread BPradhan
Dear All


Am trying to install Oracle Database 12.1.0.2 on a target host, using a 
ansible script on Ansible Master server.

On the target host 'oracle' OS user has the correct groups:



$ id oracle
uid=101(oracle) gid=204(oinstall) groups=205(dba),204(oinstall)


But the ansible script is failing with error :

 [FATAL] [INS-35341] The installation user is not a member of the 
following groups: [dba, dba, dba, dba]


---

Here is the chunk of code used in the ansible script:



  - name: ensure oinstall group exists
group: name=oinstall gid=204 state=present
become: true
become_method: su

  - name: ensure dba group exists
group: name=dba gid=205 state=present
become: true
become_method: su

  - name: ensure oracle user exists with correct groups
user: name=oracle uid=101 group=oinstall groups=dba createhome=no 
shell=/bin/bash
become: true
become_method: su

  - name: create oracle_base directory
file:
  path: "{{ oracle_base }}"
  state: directory
  owner: oracle
  group: oinstall
  mode: 0775

  - name: install base software
command: "{{ sw_library }}/oracle/{{ oracle_ver 
}}/database/runInstaller -silent -ignorePrereq -ignoreSysPrereqs 
-waitforcompletion -responseFile {{ sw_library 
}}/oracle/response_files/db_12102.rsp ORACLE_HOME={{ oracle_home }}"
register: install_db_software
args:
  creates: "{{ oracle_home }}"
failed_when: "'skipped' not in install_db_software.stdout and 
'Successfully Setup Software.' not in install_db_software.stdout"

--

And the console output from the ansible script run is:



TASK [ensure oinstall group exists] 

ok: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [ensure dba group exists] 
*
changed: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [ensure oracle user exists with correct groups] 
***
changed: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [create oracle_base directory] 

ok: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [install base software] 
***
fatal: [oradb-a01-d.adcom.ucl.ac.uk]: FAILED! => {"changed": true, "cmd": 
["/software_library/oracle/12.1.0.2/database/runInstaller", "-silent", 
"-ignorePrereq", "-ignoreSysPrereqs", "-waitforcompletion", 
"-responseFile", "/software_library/oracle/response_files/db_12102.rsp", 
"ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_1"], "delta": 
"0:00:05.125817", "end": "2016-12-08 13:46:54.465875", "failed": true, 
"failed_when_result": true, "rc": 254, "start": "2016-12-08 
13:46:49.340058", "stderr": "", "stdout": "Starting Oracle Universal 
Installer...\n\nChecking Temp space: must be greater than 500 MB.   Actual 
10480 MBPassed\nChecking swap space: must be greater than 150 MB.   
Actual 4094 MBPassed\nPreparing to launch Oracle Universal Installer 
from /tmp/OraInstall2016-12-08_01-46-49PM. Please wait ...[FATAL] 
[INS-35341] The installation user is not a member of the following groups: 
[dba, dba, dba, dba]\n   CAUSE: The installation user account must be a 
member of all groups required for installation.\n   ACTION: Ensure that the 
installation user is a member of the system privileges operating system 
groups you selected.\nA log of this session is currently saved as: 
/tmp/OraInstall2016-12-08_01-46-49PM/installActions2016-12-08_01-46-49PM.log. 
Oracle recommends that if you want to keep this log, you should move it 
from the temporary location.", "stdout_lines": ["Starting Oracle Universal 
Installer...", "", "Checking Temp space: must be greater than 500 MB.   
Actual 10480 MBPassed", "Checking swap space: must be greater than 150 
MB.   Actual 4094 MBPassed", "Preparing to launch Oracle Universal 
Installer from /tmp/OraInstall2016-12-08_01-46-49PM. Please wait ...[FATAL] 
[INS-35341] The installation user is not a member of the following groups: 
[dba, dba, dba, dba]", "   CAUSE: The installation user account must be a 
member of all groups required for installation.", "   ACTION: Ensure that 
the installation user is a member of the system privileges operating system 
groups you selected.", "A log of this session is currently saved as: 
/tmp/OraInstall2016-12-08_01-46-49PM/installActions2016-12-08_01-46-49PM.log. 
Oracle recommends that if you want to keep this log, you should move it 
from the temporary location."], "warnings": []}


---

I wonder why the script is changing for the Tasks "ensure dba group exists" 
and "ensure oracle user exists with correct groups". Since the user/group 
settings are in place before running the script. 

I also observed that the script is changing the /etc/passwd and /etc/group 
files.


Any pointer will help



Regards
BPradhan

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from 

[ansible-project] Oracle Database 12c Install using Ansible INS-35341

2016-12-08 Thread BPradhan
Dear All


Am trying to install Oracle Database 12.1.0.2 on a target host, using a 
ansible script on Ansible Master server.

On the target host 'oracle' OS user has the correct groups:



$ id oracle
uid=101(oracle) gid=204(oinstall) groups=205(dba),204(oinstall)


But the ansible script is failing with error :

 [FATAL] [INS-35341] The installation user is not a member of the 
following groups: [dba, dba, dba, dba]


---

Here is the chunk of code used in the ansible script:



  - name: ensure oinstall group exists
group: name=oinstall gid=204 state=present
become: true
become_method: su

  - name: ensure dba group exists
group: name=dba gid=205 state=present
become: true
become_method: su

  - name: ensure oracle user exists with correct groups
user: name=oracle uid=101 group=oinstall groups=dba createhome=no 
shell=/bin/bash
become: true
become_method: su

  - name: create oracle_base directory
file:
  path: "{{ oracle_base }}"
  state: directory
  owner: oracle
  group: oinstall
  mode: 0775

  - name: install base software
command: "{{ sw_library }}/oracle/{{ oracle_ver 
}}/database/runInstaller -silent -ignorePrereq -ignoreSysPrereqs 
-waitforcompletion -responseFile {{ sw_library 
}}/oracle/response_files/db_12102.rsp ORACLE_HOME={{ oracle_home }}"
register: install_db_software
args:
  creates: "{{ oracle_home }}"
failed_when: "'skipped' not in install_db_software.stdout and 
'Successfully Setup Software.' not in install_db_software.stdout"

--

And the console output from the ansible script run is:



TASK [ensure oinstall group exists] 

ok: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [ensure dba group exists] 
*
changed: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [ensure oracle user exists with correct groups] 
***
changed: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [create oracle_base directory] 

ok: [oradb-a01-d.adcom.ucl.ac.uk]

TASK [install base software] 
***
fatal: [oradb-a01-d.adcom.ucl.ac.uk]: FAILED! => {"changed": true, "cmd": 
["/software_library/oracle/12.1.0.2/database/runInstaller", "-silent", 
"-ignorePrereq", "-ignoreSysPrereqs", "-waitforcompletion", 
"-responseFile", "/software_library/oracle/response_files/db_12102.rsp", 
"ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_1"], "delta": 
"0:00:05.125817", "end": "2016-12-08 13:46:54.465875", "failed": true, 
"failed_when_result": true, "rc": 254, "start": "2016-12-08 
13:46:49.340058", "stderr": "", "stdout": "Starting Oracle Universal 
Installer...\n\nChecking Temp space: must be greater than 500 MB.   Actual 
10480 MBPassed\nChecking swap space: must be greater than 150 MB.   
Actual 4094 MBPassed\nPreparing to launch Oracle Universal Installer 
from /tmp/OraInstall2016-12-08_01-46-49PM. Please wait ...[FATAL] 
[INS-35341] The installation user is not a member of the following groups: 
[dba, dba, dba, dba]\n   CAUSE: The installation user account must be a 
member of all groups required for installation.\n   ACTION: Ensure that the 
installation user is a member of the system privileges operating system 
groups you selected.\nA log of this session is currently saved as: 
/tmp/OraInstall2016-12-08_01-46-49PM/installActions2016-12-08_01-46-49PM.log. 
Oracle recommends that if you want to keep this log, you should move it 
from the temporary location.", "stdout_lines": ["Starting Oracle Universal 
Installer...", "", "Checking Temp space: must be greater than 500 MB.   
Actual 10480 MBPassed", "Checking swap space: must be greater than 150 
MB.   Actual 4094 MBPassed", "Preparing to launch Oracle Universal 
Installer from /tmp/OraInstall2016-12-08_01-46-49PM. Please wait ...[FATAL] 
[INS-35341] The installation user is not a member of the following groups: 
[dba, dba, dba, dba]", "   CAUSE: The installation user account must be a 
member of all groups required for installation.", "   ACTION: Ensure that 
the installation user is a member of the system privileges operating system 
groups you selected.", "A log of this session is currently saved as: 
/tmp/OraInstall2016-12-08_01-46-49PM/installActions2016-12-08_01-46-49PM.log. 
Oracle recommends that if you want to keep this log, you should move it 
from the temporary location."], "warnings": []}


---

I wonder why the script is changing for the Tasks "ensure dba group exists" 
and "ensure oracle user exists with correct groups". Since the user/group 
settings are in place before running the script. 

I also observed that the script is changing the /etc/passwd and /etc/group 
files.


Any pointer will help



Regards
BPradhan

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from 

[ansible-project] ansible using versioned playbooks ala r10k

2016-12-08 Thread Vince Skahan
Working in a puppet shop, I have to admit r10k is pretty cool. It lets us 
set up 'versioned' environment definitions that we can apply to the right 
target computers, ala "use the development version of the puppet code 
(profile) that  configures package XYZ".All those profiles are in git, 
with versioning done via either branches (give me branch-XYZ latest) or via 
tags (give me tag v1.2.3). 

One discussion on serverfault was 
at 
http://serverfault.com/questions/788930/what-is-the-equivalent-of-r10k-in-ansible
 
- the preferred answer has a very good example of what a r10k Puppetfile 
looks like, and what the ansible-galaxy equivalent would be.  The question 
of course is how to do that in vanilla ansible 'without' galaxy.

Bottom line - we don't always use 'latest greatest version' of our 
automation code (puppet roles/profiles or for ansible 
roles/tasks/handlers/etc.), nor should we.  We're using the right version 
of our automation code and vars to get us the desired end state.

So, we want to be able to define our environments to say configuration-ABC 
is:

   - these variable=values definitions (from a tag or branch of a git repo)
   - these roles/tasks/handlers (from a tag or branch of a git repo, likely 
   one per thingy we're trying to install+configure)

All without ansible-galaxy, using just ansible.  How might we make that 
happen ?

Again, the link above has a great definition of how Puppet/r10k work, and 
what the galaxy equivalent would be.  I just can't afford/use galaxy at 
all.  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/990b647e-0614-4e1d-9d0f-98b6973839ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Security Mechanisms

2016-12-08 Thread Frank Albert
Hello Experts,

I am using ansible to configure my windows servers with powershell 
playbooks. Ansible servers communicates with the endpoints using WinRM 
Connections.

I fear that if in any case the ansible server gets compromised the attacker 
can modify the playbooks and execute the malicious code on all my endpoint 
windows 
Servers.

Any ideas of securing the Ansible's infrastructure.

Thanks

Frank


-- 
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/044255e1-84c6-4a4b-8709-b9e8705008ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Question: how to use variable in with_sequence, casting to int results in zero value

2016-12-08 Thread frank
Hi Kai,

Thanks for your reaction.

I think item.path won't work because of the structure of result.files. 
result.files contains a list  [..path..], [.path..]  ,So in the debug var i 
should reference item[0].path , item[1].path

I worked my way around creating a list

# create a list of policies to be defined
- name: create list of files
  debug:
msg: "{{ result.files | map(attribute='path') | list }}"
  register: fileList


Op donderdag 1 december 2016 20:02:44 UTC+1 schreef Kai Stian Olstad:
>
> On 30. nov. 2016 09:52, fr...@tom.nl  wrote: 
> > I am trying to process the result from the find module. The result 
> contains 
> > 3 file paths which i would  like to process in a loop. 
> > The number of files depends on the number of files found in the 
> directories 
> > and is set by result.matched 
> > 
> > Using the with_sequence loop should do the trick, i think. But i ran 
> into a 
> > problem. 
> > 
> > with_sequence: start=0 end={{ variable }}, expects {{ variable }} to be 
> an 
> > integer. Casting {{ variable | int}} results in a zero value, which 
> should 
> > be 3. 
> > 
> > Any suggestions how to solve or work around my issue? 
>
> Why not use with_items? 
>
>
> > After casting the variable correctly to an integer, off course i still 
> have 
> > to subtract 1 to set the correct index value for the results array. 
> > 
> > *Variables*: 
> > 
> > file_path: "roles/ansible-role-iamGroups/files" 
> > template_path: "roles/ansible-role-iamGroups/templates" 
> > 
> > declared_int: 3 
> > 
> > *Tasks*: 
> > 
> > - name: find files 
> >   find: 
> > recurse: yes 
> > patterns: "*.json" 
> > paths: 
> > 
> "/home/user/PycharmProjects/playbook-aws-billing/roles/ansible-role-iamGroups/templates/"
>  
>
> >   register: result 
> > 
> > - name: register numbers variable 
> >   shell: "echo {{result.matched}}" 
> >   register: number 
> > 
> > - name: list number variable (==> string value 3) 
> >   debug: var=number 
> > 
> > - name: list result hard coded (works) 
> >   debug: "var=result.files[{{item}}].path" 
> >   with_sequence: "start=0 end=2 stride=1" 
>
> - name: list result 
>debug: var=item.path 
>with_items: result.files 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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/fcbb0993-9581-47e3-871a-00f310177261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] update of ansible seems to be inconsistent

2016-12-08 Thread Sebastian S.
In fact there is one. But when I run this one something goes wrong:

ansible@DE9899S76 /etc/ansible/roles % /usr/bin/ansible  
Traceback (most recent call last):
  File "/usr/bin/ansible", line 46, in 
from ansible.module_utils._text import to_text
ImportError: No module named _text


Am Donnerstag, 8. Dezember 2016 09:02:31 UTC+1 schrieb Andreas Olsson:
>
> ons 2016-12-07 klockan 23:40 -0800 skrev Sebastian S.: 
> > which ansible says: /usr/local/bin/ansible 
>
> That looks more like somewhere where Pip would install Ansible, or 
> where someone would install Ansible manually. Any chance that you also 
> have a /usr/bin/ansible, which better match the apt version? 
>
> // Andreas 
>

-- 
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/0f2afbf2-132f-47c2-a91b-49711fdb2bb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to perform tasks only one host, based on previous output

2016-12-08 Thread Kevin Csuka
Hi,

My goal is to perform tasks only one host based on the output. Searched for 
--limit module to use in playbooks, but it is not present.

A shell script is executed on 3 nodes, which returns a boolean.

ok: [localMulti1] => {
"variable": {
...
"stdout": "true",
...
}
}
ok: [localMulti2] => {
"variable": {
...
"stdout": "false",
...
}
}
ok: [localMulti3] => {
"variable": {
...
"stdout": "false",
...
}
}

How can I perform tasks on only on localMulti2? But not statically include 
the host (inventory_hostname == '...')

Failing with:

- shell: echo
  when: variable.stdout == "false" and ...

-- 
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/4c7da7c4-a65a-49b7-9641-c11790fffc6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] update of ansible seems to be inconsistent

2016-12-08 Thread Andreas Olsson
ons 2016-12-07 klockan 23:40 -0800 skrev Sebastian S.:
> which ansible says: /usr/local/bin/ansible

That looks more like somewhere where Pip would install Ansible, or
where someone would install Ansible manually. Any chance that you also
have a /usr/bin/ansible, which better match the apt version?

// Andreas

-- 
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/1481184141.2546.2.camel%40arrakis.se.
For more options, visit https://groups.google.com/d/optout.