[ansible-project] Re: Ziploader merged to devel. New features in progress

2016-04-05 Thread Toshio Kuratomi
On Tue, Apr 5, 2016 at 8:43 PM, Toshio Kuratomi 
wrote:

> * This branch can be slow.
>- I did a highly artificial test that called the ping module on a
> thousand hosts (all aliases of localhost).  This was about 40% slower
> than the pre-ziploader baseline I took a few days ago.
>- I did a second highly artificial test that called the ping module
> on a thousand hosts (all aliases of a local vm I have here).  This was
> just a tad slower than the pre-ziploader code... close enough that it
> could disappear if I do further testing.
>- I ran a subset of the integration tests that I'd previously
> baselined.  These tests all use the local connection plugin (like the
> first ping test).  It was 115% slower than the baseline I took a few
> days ago.
>
I realized that my integration performance test failed to account for the
fact that one of the tests is installing an OS package.  When the OS
package manager's metadata is out of date the test takes much longer to run
than when the cache is fresh.  Reran my performance tests with the
following results:

(pipelining=True and module_compression=ZIP_DEFLATED for these tests)

Branch  Ping (local)   Ping (net)   Integration
==     ==   ===
pre-ziploader devel real 29.95 real 53.65   real 129.82
ziploader devel (current HEAD)  real 30.83 real 54.16   real 131.99
ziploader, nonrecursive ast.parse   real 30.74 real 53.35   real 135.70
ziploader, recursive ast.parse  real 49.29 real 58.21   real 155.48

So the integration tests are only about 15% slower.  Ping across ssh to a
local vm (1000 host aliases) is under 10% slower.  Ping to localhost is the
big loser at ~65% slower.

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


Re: [ansible-project] 'AnsibleError: unable to process as utf-8

2016-04-05 Thread Gidhin Joy
Thanks Toshio. In that case  I can workaround with "copy" module.


On Wednesday, April 6, 2016 at 1:03:34 PM UTC+10, tkuratomi wrote:
>
> Ansible does not currently handle non-ut8 data in playbooks or most of 
> its text-processing modules.  template would fall under the latter 
> category.  Due to the way jinja2 works it may be that template (which 
> is a jinja2 template) may never handle that.  If you tell us what 
> you're attempting to do we might be able to help you find an alternate 
> method of doing it.  You may have to resort to using command: and 
> basic unix tools in the workaround, though. 
>
> -Toshio 
>
> On Tue, Apr 5, 2016 at 3:53 AM, Gidhin Joy > 
> wrote: 
> > Greetings. 
> > 
> > I am trying to setup  a playbook  for automating an installation. 
> > 
> > 
> > While transferring a file (binary response file) through template 
> module, getting following error. 
> > 
> > 
> > fatal: [..local] => {'msg': 'AnsibleError: unable to process as 
> utf-8: /etc/ansible/ORA_Patch/templates/ocm_12cLinux_PSU_Jan2016.rsp', 
> 'failed': True} 
> > 
> > 
> > Any advice on this please. 
> > 
> > Thanks. 
> > GJ 
> > 
> > 
> > -- 
> > 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/0ea5dfcc-0752-4e7a-8231-9d074466a4f4%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/5881f589-b239-4c46-8365-95bfad13b90f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ziploader merged to devel. New features in progress

2016-04-05 Thread Toshio Kuratomi
I merged the first ziploader PR (
https://github.com/ansible/ansible/pull/15246 ) into devel this
morning.  So far, everything seems to be working.  So that's one
step.forward.

There's a few other features that I wanted to get working for
ziploader before our feature freeze on April 18th..  Notably, other
valid ways of specifying python imports and "recursive imports" --
allowing module_utils code to import other module_utils code.  Today I
pushed a new ziploader branch in my repository that adds both those
features.  However, there's some caveats and performance issues that I
have to iron out before they'd be ready to merge:

Here's the code, ready for any testing and suggestions that you'd like
to make : https://github.com/ansible/ansible/compare/devel...abadger:ziploader
 So far its passed all my testing for correctness.

Here's the problems I know about:

* This branch can be slow.
   - I did a highly artificial test that called the ping module on a
thousand hosts (all aliases of localhost).  This was about 40% slower
than the pre-ziploader baseline I took a few days ago.
   - I did a second highly artificial test that called the ping module
on a thousand hosts (all aliases of a local vm I have here).  This was
just a tad slower than the pre-ziploader code... close enough that it
could disappear if I do further testing.
   - I ran a subset of the integration tests that I'd previously
baselined.  These tests all use the local connection plugin (like the
first ping test).  It was 115% slower than the baseline I took a few
days ago.

I may be able to use controller-side caching to address this.  For any
given ansible run, only process the module once to assemble all of the
dependencies into the zip file.  ansible will still need to add the
module's parameters to the wrapper every time but that's just string
formatting so it shouldn't be as time consuming as scanning the module
and its module_utils deps.  The cache would be cleared between every
ansible invocation.

Another option could be to not rely so heavily on ast.parse to figure
out what's an import and what isn't.  I need to do a bit of testing to
determine whether it's the use of ast.parse or the fact that we're
scanning multiple files that's leading to most of the slowdown before
embarking on this.  ast.parse isn't cheap but it makes it trivial to
know whether we have ansible.module_utils imports to deal with.  Doing
our own parsing will be much more complex.

Caveats:

* Currently doesn't handle relative imports ("from .urls import
fetch_url").  ansible.module_utils has to appear in the import
statement.  This is something I don't think should be too hard to add
but I'm not deeply bothered about not being able to do it.  Relative
imports in python2.4 are bad because the syntax there is ambiguous.
We can always use from ansible.module_utils[...], there's no need to
use the relative import.  I want to address performance before I
clutter up the code with handling for this.

* Currently this code only handles python modules, not python
packages.  What that means is that it handles *.py files directly
inside of module_utils/.  It does not handle a directory in
module_utils that contains an __init__.py and other *.py files.  This
deficiency bothers me much more than lack of relative imports.  but it
will be even more costly to perform than what we currently have.  So
I'm not anxious to add directories that we have to scan until after
I've had a chance to optimize the code to see if recursive python
module files can be made fast enough.

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


Re: [ansible-project] 'AnsibleError: unable to process as utf-8

2016-04-05 Thread Toshio Kuratomi
Ansible does not currently handle non-ut8 data in playbooks or most of
its text-processing modules.  template would fall under the latter
category.  Due to the way jinja2 works it may be that template (which
is a jinja2 template) may never handle that.  If you tell us what
you're attempting to do we might be able to help you find an alternate
method of doing it.  You may have to resort to using command: and
basic unix tools in the workaround, though.

-Toshio

On Tue, Apr 5, 2016 at 3:53 AM, Gidhin Joy  wrote:
> Greetings.
>
> I am trying to setup  a playbook  for automating an installation.
>
>
> While transferring a file (binary response file) through template module, 
> getting following error.
>
>
> fatal: [..local] => {'msg': 'AnsibleError: unable to process as 
> utf-8: /etc/ansible/ORA_Patch/templates/ocm_12cLinux_PSU_Jan2016.rsp', 
> 'failed': True}
>
>
> Any advice on this please.
>
> Thanks.
> GJ
>
>
> --
> 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/0ea5dfcc-0752-4e7a-8231-9d074466a4f4%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/CAG9juEqqzA6aR4F66dkvG%2BML5zA5qBQyPU3c16Qhjd8PYxrZkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Google Cloud: Target proxies and SSL certificate resources

2016-04-05 Thread Ivan Jaros
Hi,
I am setting up GCE infrastructure and I need to be able to configure 
target proxies for LB and ssl certificates(resources) for them as well but 
I haven't found anything in documentation.
Is there some documentation that I have missed or is this currently 
unsupported by Ansible?

-- 
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/3ab93955-72d2-4c78-a05b-6ad3d2be879d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 2.0 window modules

2016-04-05 Thread 田村泰晴
I do not get off with a strange sentence.
I think that it is OK if I escape "\"
win_file: path="C:\\MySource" state=directory

2016年4月1日金曜日 10時59分46秒 UTC+9 Quang Truong:

> Hi all,
>
> I'm using Ansible 2.0 but I have problem with:
> - win_file: can't create new directory
>
> sample playbook
>
> - name: create Source directory
>   win_file: path=C:\MySource state=directory
>
>
> - win_service: can't manage windows service (no affect). The input name is 
> the service name (service name is the same with service display name)
>
>
> sample playbook:
>
> - name: update service My_Service stopped
>   win_service:
> name: My_Service
> state: stopped
>
>
> Do you have any idea?
>
>
> Thanks,
>
> Quang
>
>

-- 
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/7cc22cc2-169c-485a-ac56-8aa45803d62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: redhat-subscription causing issues?

2016-04-05 Thread Greg DeKoenigsberg
That would be great. Ping me in the pr (@gregdek).
On Apr 5, 2016 8:37 PM, "Adam Morris"  wrote:

> Greg,
> It wouldn't hurt to fix them, it might be better to also add a comment
> "Pool ids shown are examples.  Available pools can be seen with the
> following command."
>
> Should I go do that and submit a pull request?
>
> Adam
> On Apr 5, 2016 5:22 PM, "Greg DeKoenigsberg"  wrote:
>
>> Do we need to change the module docs?
>> On Apr 5, 2016 7:43 PM, "Adam Morris"  wrote:
>>
>>>
>>> You sir, are a Genius...
>>>
>>> Your employer however irks me
>>>
>>> Yes, that was an exact excerpt from the playbook.  And yes, the pool
>>> name was wrong.  But the playbook USED to work and I got that pool name
>>> from Red Hat Subscription Manager a while back.  Not only that, but that
>>> pool name is used in the examples in the Ansible documentation (proof to me
>>> that I wasn't imagining it)... So I suspect that at some point in the last
>>> month or so Red Hat changed the name of the pool.  (Or fixed it so that the
>>> wrong name would no longer work).
>>>
>>> Anyway...
>>>
>>> Thank you for your assistance.
>>>
>>> Adam
>>>
>>>
>>>
>>>
>>> On Tuesday, April 5, 2016 at 3:08:54 PM UTC-7, ali...@redhat.com wrote:


 It does sound like the system isn't attached to any subscription pools,
 which likely means
 auto-attach failed (or possibly, if it was working before, that a
 subscription expired).

 /var/log/rhsm/rhsm.log on that system should indicate if there was a
 failure. Also just
 checking 'subscription-manager list' or 'subscription-manager repos
 --list-enabled' to
 see if it's registered but not attached ('subscribed') or if it's
 registered+subscribed but
 missing applicable repos.

 Oh, and if that's a direct cut of the playbook, the pool name may be
 wrong
 [ 'RedHat Enterprise Server' vs 'Red Hat Enterprise Linux Server' etc)

 On Monday, April 4, 2016 at 6:36:58 PM UTC-4, Adam Morris wrote:
>
> Greetings,
>
> I have been using Ansible for a while now and one of my playbooks for
> configuring servers includes this...
>
> - name: Register a Redhat system (>= RHEL 6)
>   redhat_subscription: state=present username=
> password=
>  pool='\ARedHat Enterprise Server\Z'
> autosubscribe=true
>   when: ansible_distribution == "RedHat" and
> ansible_distribution_version >= "6.0"
>
> - name: make sure yum-utils is installed
>   raw: yum -y install yum-utils
>   when: ansible_os_family == "RedHat"
>
> This was working perfectly, but recently I have been getting errors
> like this...
>
> TASK [common : Register a Redhat system (>= RHEL 6)]
> ***
>
> ok: [u90324]
>
>
>
> TASK [common : make sure yum-utils is installed]
> ***
>
> fatal: [u90324]: FAILED! => {"changed": false, "failed": true, "rc":
> 1, "stderr": "", "stdout": "Loaded plugins: langpacks, product-id,
> subscription-manager\r\nThis system is registered to Red Hat Subscription
> Management, but is not receiving updates. You can use subscription-manager
> to assign subscriptions.\r\nThere are no enabled repos.\r\n Run \"yum
> repolist all\" to see the repos you have.\r\n You can enable repos with
> yum-config-manager --enable \r\n", "stdout_lines": ["Loaded plugins:
> langpacks, product-id, subscription-manager", "This system is registered 
> to
> Red Hat Subscription Management, but is not receiving updates. You can use
> subscription-manager to assign subscriptions.", "There are no enabled
> repos.", " Run \"yum repolist all\" to see the repos you have.", " You can
> enable repos with yum-config-manager --enable "]}
>
>
> I think that this might be an issue with subscription manager rather
> than Ansible,  but has anyone else seen this or is this just my problem?  
> I
> am wondering whether RedHat has broken auto-attach...  Probably time to
> break out the VM and test this all again.
>
>
> Thanks,
>
>
> Adam
>
 --
>>> 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/80ec9610-9d1b-46cc-990d-9cd6ef4020d7%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to a topic 

Re: [ansible-project] Re: redhat-subscription causing issues?

2016-04-05 Thread Adam Morris
Greg,
It wouldn't hurt to fix them, it might be better to also add a comment
"Pool ids shown are examples.  Available pools can be seen with the
following command."

Should I go do that and submit a pull request?

Adam
On Apr 5, 2016 5:22 PM, "Greg DeKoenigsberg"  wrote:

> Do we need to change the module docs?
> On Apr 5, 2016 7:43 PM, "Adam Morris"  wrote:
>
>>
>> You sir, are a Genius...
>>
>> Your employer however irks me
>>
>> Yes, that was an exact excerpt from the playbook.  And yes, the pool name
>> was wrong.  But the playbook USED to work and I got that pool name from Red
>> Hat Subscription Manager a while back.  Not only that, but that pool name
>> is used in the examples in the Ansible documentation (proof to me that I
>> wasn't imagining it)... So I suspect that at some point in the last month
>> or so Red Hat changed the name of the pool.  (Or fixed it so that the wrong
>> name would no longer work).
>>
>> Anyway...
>>
>> Thank you for your assistance.
>>
>> Adam
>>
>>
>>
>>
>> On Tuesday, April 5, 2016 at 3:08:54 PM UTC-7, ali...@redhat.com wrote:
>>>
>>>
>>> It does sound like the system isn't attached to any subscription pools,
>>> which likely means
>>> auto-attach failed (or possibly, if it was working before, that a
>>> subscription expired).
>>>
>>> /var/log/rhsm/rhsm.log on that system should indicate if there was a
>>> failure. Also just
>>> checking 'subscription-manager list' or 'subscription-manager repos
>>> --list-enabled' to
>>> see if it's registered but not attached ('subscribed') or if it's
>>> registered+subscribed but
>>> missing applicable repos.
>>>
>>> Oh, and if that's a direct cut of the playbook, the pool name may be
>>> wrong
>>> [ 'RedHat Enterprise Server' vs 'Red Hat Enterprise Linux Server' etc)
>>>
>>> On Monday, April 4, 2016 at 6:36:58 PM UTC-4, Adam Morris wrote:

 Greetings,

 I have been using Ansible for a while now and one of my playbooks for
 configuring servers includes this...

 - name: Register a Redhat system (>= RHEL 6)
   redhat_subscription: state=present username=
 password=
  pool='\ARedHat Enterprise Server\Z'
 autosubscribe=true
   when: ansible_distribution == "RedHat" and
 ansible_distribution_version >= "6.0"

 - name: make sure yum-utils is installed
   raw: yum -y install yum-utils
   when: ansible_os_family == "RedHat"

 This was working perfectly, but recently I have been getting errors
 like this...

 TASK [common : Register a Redhat system (>= RHEL 6)]
 ***

 ok: [u90324]



 TASK [common : make sure yum-utils is installed]
 ***

 fatal: [u90324]: FAILED! => {"changed": false, "failed": true, "rc": 1,
 "stderr": "", "stdout": "Loaded plugins: langpacks, product-id,
 subscription-manager\r\nThis system is registered to Red Hat Subscription
 Management, but is not receiving updates. You can use subscription-manager
 to assign subscriptions.\r\nThere are no enabled repos.\r\n Run \"yum
 repolist all\" to see the repos you have.\r\n You can enable repos with
 yum-config-manager --enable \r\n", "stdout_lines": ["Loaded plugins:
 langpacks, product-id, subscription-manager", "This system is registered to
 Red Hat Subscription Management, but is not receiving updates. You can use
 subscription-manager to assign subscriptions.", "There are no enabled
 repos.", " Run \"yum repolist all\" to see the repos you have.", " You can
 enable repos with yum-config-manager --enable "]}


 I think that this might be an issue with subscription manager rather
 than Ansible,  but has anyone else seen this or is this just my problem?  I
 am wondering whether RedHat has broken auto-attach...  Probably time to
 break out the VM and test this all again.


 Thanks,


 Adam

>>> --
>> 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/80ec9610-9d1b-46cc-990d-9cd6ef4020d7%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/3BS4BpVpf7I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-

Re: [ansible-project] Re: redhat-subscription causing issues?

2016-04-05 Thread Greg DeKoenigsberg
Do we need to change the module docs?
On Apr 5, 2016 7:43 PM, "Adam Morris"  wrote:

>
> You sir, are a Genius...
>
> Your employer however irks me
>
> Yes, that was an exact excerpt from the playbook.  And yes, the pool name
> was wrong.  But the playbook USED to work and I got that pool name from Red
> Hat Subscription Manager a while back.  Not only that, but that pool name
> is used in the examples in the Ansible documentation (proof to me that I
> wasn't imagining it)... So I suspect that at some point in the last month
> or so Red Hat changed the name of the pool.  (Or fixed it so that the wrong
> name would no longer work).
>
> Anyway...
>
> Thank you for your assistance.
>
> Adam
>
>
>
>
> On Tuesday, April 5, 2016 at 3:08:54 PM UTC-7, ali...@redhat.com wrote:
>>
>>
>> It does sound like the system isn't attached to any subscription pools,
>> which likely means
>> auto-attach failed (or possibly, if it was working before, that a
>> subscription expired).
>>
>> /var/log/rhsm/rhsm.log on that system should indicate if there was a
>> failure. Also just
>> checking 'subscription-manager list' or 'subscription-manager repos
>> --list-enabled' to
>> see if it's registered but not attached ('subscribed') or if it's
>> registered+subscribed but
>> missing applicable repos.
>>
>> Oh, and if that's a direct cut of the playbook, the pool name may be wrong
>> [ 'RedHat Enterprise Server' vs 'Red Hat Enterprise Linux Server' etc)
>>
>> On Monday, April 4, 2016 at 6:36:58 PM UTC-4, Adam Morris wrote:
>>>
>>> Greetings,
>>>
>>> I have been using Ansible for a while now and one of my playbooks for
>>> configuring servers includes this...
>>>
>>> - name: Register a Redhat system (>= RHEL 6)
>>>   redhat_subscription: state=present username=
>>> password=
>>>  pool='\ARedHat Enterprise Server\Z'
>>> autosubscribe=true
>>>   when: ansible_distribution == "RedHat" and
>>> ansible_distribution_version >= "6.0"
>>>
>>> - name: make sure yum-utils is installed
>>>   raw: yum -y install yum-utils
>>>   when: ansible_os_family == "RedHat"
>>>
>>> This was working perfectly, but recently I have been getting errors like
>>> this...
>>>
>>> TASK [common : Register a Redhat system (>= RHEL 6)]
>>> ***
>>>
>>> ok: [u90324]
>>>
>>>
>>>
>>> TASK [common : make sure yum-utils is installed]
>>> ***
>>>
>>> fatal: [u90324]: FAILED! => {"changed": false, "failed": true, "rc": 1,
>>> "stderr": "", "stdout": "Loaded plugins: langpacks, product-id,
>>> subscription-manager\r\nThis system is registered to Red Hat Subscription
>>> Management, but is not receiving updates. You can use subscription-manager
>>> to assign subscriptions.\r\nThere are no enabled repos.\r\n Run \"yum
>>> repolist all\" to see the repos you have.\r\n You can enable repos with
>>> yum-config-manager --enable \r\n", "stdout_lines": ["Loaded plugins:
>>> langpacks, product-id, subscription-manager", "This system is registered to
>>> Red Hat Subscription Management, but is not receiving updates. You can use
>>> subscription-manager to assign subscriptions.", "There are no enabled
>>> repos.", " Run \"yum repolist all\" to see the repos you have.", " You can
>>> enable repos with yum-config-manager --enable "]}
>>>
>>>
>>> I think that this might be an issue with subscription manager rather
>>> than Ansible,  but has anyone else seen this or is this just my problem?  I
>>> am wondering whether RedHat has broken auto-attach...  Probably time to
>>> break out the VM and test this all again.
>>>
>>>
>>> Thanks,
>>>
>>>
>>> Adam
>>>
>> --
> 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/80ec9610-9d1b-46cc-990d-9cd6ef4020d7%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/CAM1FbhEbOX6onALDYP39oX4Ua33DqG-HM0eC1moNFU%3DynyJKaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: redhat-subscription causing issues?

2016-04-05 Thread Adam Morris

You sir, are a Genius... 

Your employer however irks me

Yes, that was an exact excerpt from the playbook.  And yes, the pool name 
was wrong.  But the playbook USED to work and I got that pool name from Red 
Hat Subscription Manager a while back.  Not only that, but that pool name 
is used in the examples in the Ansible documentation (proof to me that I 
wasn't imagining it)... So I suspect that at some point in the last month 
or so Red Hat changed the name of the pool.  (Or fixed it so that the wrong 
name would no longer work).

Anyway...

Thank you for your assistance.

Adam




On Tuesday, April 5, 2016 at 3:08:54 PM UTC-7, ali...@redhat.com wrote:
>
>
> It does sound like the system isn't attached to any subscription pools, 
> which likely means
> auto-attach failed (or possibly, if it was working before, that a 
> subscription expired).
>
> /var/log/rhsm/rhsm.log on that system should indicate if there was a 
> failure. Also just
> checking 'subscription-manager list' or 'subscription-manager repos 
> --list-enabled' to
> see if it's registered but not attached ('subscribed') or if it's 
> registered+subscribed but
> missing applicable repos.
>
> Oh, and if that's a direct cut of the playbook, the pool name may be wrong
> [ 'RedHat Enterprise Server' vs 'Red Hat Enterprise Linux Server' etc)
>
> On Monday, April 4, 2016 at 6:36:58 PM UTC-4, Adam Morris wrote:
>>
>> Greetings,
>>
>> I have been using Ansible for a while now and one of my playbooks for 
>> configuring servers includes this...
>>
>> - name: Register a Redhat system (>= RHEL 6)
>>   redhat_subscription: state=present username= 
>> password=
>>  pool='\ARedHat Enterprise Server\Z' 
>> autosubscribe=true
>>   when: ansible_distribution == "RedHat" and ansible_distribution_version 
>> >= "6.0"
>>
>> - name: make sure yum-utils is installed
>>   raw: yum -y install yum-utils
>>   when: ansible_os_family == "RedHat"
>>
>> This was working perfectly, but recently I have been getting errors like 
>> this...
>>
>> TASK [common : Register a Redhat system (>= RHEL 6)] 
>> ***
>>
>> ok: [u90324]
>>
>>   
>>
>> TASK [common : make sure yum-utils is installed] 
>> ***
>>
>> fatal: [u90324]: FAILED! => {"changed": false, "failed": true, "rc": 1, 
>> "stderr": "", "stdout": "Loaded plugins: langpacks, product-id, 
>> subscription-manager\r\nThis system is registered to Red Hat Subscription 
>> Management, but is not receiving updates. You can use subscription-manager 
>> to assign subscriptions.\r\nThere are no enabled repos.\r\n Run \"yum 
>> repolist all\" to see the repos you have.\r\n You can enable repos with 
>> yum-config-manager --enable \r\n", "stdout_lines": ["Loaded plugins: 
>> langpacks, product-id, subscription-manager", "This system is registered to 
>> Red Hat Subscription Management, but is not receiving updates. You can use 
>> subscription-manager to assign subscriptions.", "There are no enabled 
>> repos.", " Run \"yum repolist all\" to see the repos you have.", " You can 
>> enable repos with yum-config-manager --enable "]}
>>
>>
>> I think that this might be an issue with subscription manager rather than 
>> Ansible,  but has anyone else seen this or is this just my problem?  I am 
>> wondering whether RedHat has broken auto-attach...  Probably time to break 
>> out the VM and test this all again.
>>
>>
>> Thanks,
>>
>>
>> Adam
>>
>

-- 
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/80ec9610-9d1b-46cc-990d-9cd6ef4020d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: redhat-subscription causing issues?

2016-04-05 Thread alikins

It does sound like the system isn't attached to any subscription pools, 
which likely means
auto-attach failed (or possibly, if it was working before, that a 
subscription expired).

/var/log/rhsm/rhsm.log on that system should indicate if there was a 
failure. Also just
checking 'subscription-manager list' or 'subscription-manager repos 
--list-enabled' to
see if it's registered but not attached ('subscribed') or if it's 
registered+subscribed but
missing applicable repos.

Oh, and if that's a direct cut of the playbook, the pool name may be wrong
[ 'RedHat Enterprise Server' vs 'Red Hat Enterprise Linux Server' etc)

On Monday, April 4, 2016 at 6:36:58 PM UTC-4, Adam Morris wrote:
>
> Greetings,
>
> I have been using Ansible for a while now and one of my playbooks for 
> configuring servers includes this...
>
> - name: Register a Redhat system (>= RHEL 6)
>   redhat_subscription: state=present username= 
> password=
>  pool='\ARedHat Enterprise Server\Z' 
> autosubscribe=true
>   when: ansible_distribution == "RedHat" and ansible_distribution_version 
> >= "6.0"
>
> - name: make sure yum-utils is installed
>   raw: yum -y install yum-utils
>   when: ansible_os_family == "RedHat"
>
> This was working perfectly, but recently I have been getting errors like 
> this...
>
> TASK [common : Register a Redhat system (>= RHEL 6)] 
> ***
>
> ok: [u90324]
>
>   
>
> TASK [common : make sure yum-utils is installed] 
> ***
>
> fatal: [u90324]: FAILED! => {"changed": false, "failed": true, "rc": 1, 
> "stderr": "", "stdout": "Loaded plugins: langpacks, product-id, 
> subscription-manager\r\nThis system is registered to Red Hat Subscription 
> Management, but is not receiving updates. You can use subscription-manager 
> to assign subscriptions.\r\nThere are no enabled repos.\r\n Run \"yum 
> repolist all\" to see the repos you have.\r\n You can enable repos with 
> yum-config-manager --enable \r\n", "stdout_lines": ["Loaded plugins: 
> langpacks, product-id, subscription-manager", "This system is registered to 
> Red Hat Subscription Management, but is not receiving updates. You can use 
> subscription-manager to assign subscriptions.", "There are no enabled 
> repos.", " Run \"yum repolist all\" to see the repos you have.", " You can 
> enable repos with yum-config-manager --enable "]}
>
>
> I think that this might be an issue with subscription manager rather than 
> Ansible,  but has anyone else seen this or is this just my problem?  I am 
> wondering whether RedHat has broken auto-attach...  Probably time to break 
> out the VM and test this all again.
>
>
> Thanks,
>
>
> Adam
>

-- 
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/6a8eace7-5d1a-4326-8599-1be1dcebdbee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 1.9.4 CERTIFICATE_VERIFY_FAILED when connecting to Windows Server

2016-04-05 Thread Eduardo Cerqueira
So just sharing the solution presented below by Slim Slam, also works on 
Fedora 23. Again, I understand it is not an ideal solution but if you are 
tied on any Ansible version < 2 and can't upgrade, it works as a temporally 
solution or workaround.

On Sunday, October 11, 2015 at 1:21:05 AM UTC-4, Slim Slam wrote:
>
>
> Using Ansible 1.9.4 and Python 2.7.10 on MacOSX 10.10.5
>
> When attempting:
>
> env ANSIBLE_LOAD_CALLBACK_PLUGINS=1 ansible winserv -i ../windows_servers 
> -m win_ping
>
> I get:
>
> 54.68.166.123 | FAILED => 500 WinRMTransport. [SSL: 
> CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
>
> As suggested in previous postings, I have a file named fix-ssl.py in my 
> callback_plugins folder:
>
> import ssl
> if hasattr(ssl, '_create_default_https_context') and hasattr(ssl, 
> '_create_unverified_context'):
> ssl._create_default_https_context = ssl._create_unverified_context
>
> class CallbackModule(object):
> pass
>
> And in my ansible.cfg file, I have:
>
> bin_ansible_callbacks=True
> callback_plugins = /callback_plugins/fix-ssl.py
>
> How can I get this to work?
>
>

-- 
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/eb26e8d4-de35-4d0b-a35c-b7946e8ab6f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Implementation question

2016-04-05 Thread Marcos Alano
Hi fellows!

I'm a relatively new on Ansible. I can write some code, but I don't know 
how to do some things in the best possible way. So what's why I'm asking 
for help.
First, a little of contextualization: I'm working in my college on a 
project about personal health records. The idea is create a system on a 
private cloud to store this records. This cloud is based on OpenStack but 
for tests I would like use KVM (but I can use LXC as well).
There will be just one virtual machine image for all types of machines 
(databases, message queues, load balancers, etc.) and each type of machine 
will receive specific customizations (like package installation) from 
Ansible.
So after boot up a minimum machine it will become different for each task.
 My problem is: How  could I deploy this machines? I would like each 
machine has a identifier (to specific the type of machine and instance 
number) and inventory was feeded by OpenStack.

Thanks and if you have any question I would love to answer.

Cheers.

-- 
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/82f81edf-ba5a-4d4e-a805-598ee842b845%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to get host/group name for dynamic inventory?

2016-04-05 Thread Souren Abeghyan


Having ec2 dynamic inventory and pattern in hosts:

- hosts: [tag_Name_m*]

which variable holds the full host/tag/group name?

-- 
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/f153c6ef-286b-4709-80f2-8814c902f068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] New modules report: 05-Apr-2016

2016-04-05 Thread Greg DeKoenigsberg
There are currently 163 modules waiting for inclusion in Ansible
Extras. One of them might be useful to you!

New modules this week:

[WIP] Let's Encrypt module
https://github.com/ansible/ansible-modules-extras/pull/1962

Pulp repo
https://github.com/ansible/ansible-modules-extras/pull/1961

grub2_hash new module
https://github.com/ansible/ansible-modules-extras/pull/1949

Add git_config module
https://github.com/ansible/ansible-modules-extras/pull/1945

Add honeybadger_deployment module
https://github.com/ansible/ansible-modules-extras/pull/1942

Adding new ec2 security group facts module.
https://github.com/ansible/ansible-modules-extras/pull/1939

The oldest unreviewed module in the queue (please give it some love this week):

Ansible module to create and delete Couchbase buckets
https://github.com/ansible/ansible-modules-extras/pull/35

Full list of modules is here:

https://github.com/ansible/ansible-modules-extras/labels/new_plugin

If you think one of these modules might be useful to you, please
download it and test it.

If you've tested a module and found issues, please respond with
"needs_revision" in the pull request, with details about the revisions
you'd like to see.

If you've tested a module and it works for you, please help us by
commenting with "shipit" in the pull request.  (Please do not give a
"shipit" without actually testing the module first!)

Two "shipit" comments and no "needs_revision" comments will move it to
final review for inclusion in the next release.

Thanks for your help in testing Ansible modules!

-- 
Greg DeKoenigsberg
Ansible Community Guy

-- 
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/CAM1FbhEC4gP3BTwJjBvheAp1Yi%3DUQLSdU%3DQ1ka%3DztY6m%3DmM2LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] AnsibleError: unable to process as utf-8

2016-04-05 Thread Gidhin Joy


 

Greetings Group Members.

 

 

Came across this strange error while transferring a file (binary response 
file) through template module. Any help on this please..


TASK: [ORA_Patch | Transfer response file ***

fatal: [..local] => {'msg': 'AnsibleError: unable to process as 
utf-8: /etc/ansible/ORA_Patch/templates/ocm_12cLinux_PSU_Jan2016.rsp', 
'failed': True}

fatal: [..local] => {'msg': 'AnsibleError: unable to process as 
utf-8: /etc/ansible/ORA_Patch/templates/ocm_12cLinux_PSU_Jan2016.rsp', 
'failed': True}


Thnaks,

GJ

-- 
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/0d1760f4-300f-48a0-bcf5-e99b90da36d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Access the --tags value that was specified in commandline

2016-04-05 Thread Cyril Panshine
Is there a way to get the value of tags passed to the `ansible-playbook` 
commandline via --tags parameter?

I need to access it from the 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/43a35349-8efa-4894-a83f-20970f2e91d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] 'AnsibleError: unable to process as utf-8

2016-04-05 Thread Gidhin Joy
Greetings.

I am trying to setup  a playbook  for automating an installation.

 
While transferring a file (binary response file) through template module, 
getting following error.


fatal: [..local] => {'msg': 'AnsibleError: unable to process as utf-8: 
/etc/ansible/ORA_Patch/templates/ocm_12cLinux_PSU_Jan2016.rsp', 'failed': True}

 
Any advice on this please.

Thanks.
GJ
 

-- 
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/0ea5dfcc-0752-4e7a-8231-9d074466a4f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Launching applications remotely with GUI

2016-04-05 Thread 'J Hawkesworth' via Ansible Project
Generally ansible is intended to fail if the modules can't achieve their 
goals.  When I'm developing playbooks I do sometime watch the GUI, although 
much of the checking I do is automated, typically by using register 
http://docs.ansible.com/ansible/playbooks_variables.html#registered-variables 
to record the state returned by modules and then using assert 
http://docs.ansible.com/ansible/assert_module.html to ensure the returned 
state is what I expect.

Its true that some of the checking I do does rely on Powershell, although 
often this can be accomplished with a single-line Powershell command, for 
example

- name: check if Windows8.1-KB2999226-x64.msu hotfix has been applied
  raw: Get-Hotfix -Id KB2999226
  register: hotfix_status
  ignore_errors: true


I've used Get-Process in a similar way - something like

Get-Process -Name notepad

Hope this helps,

Jon


On Tuesday, 5 April 2016 12:20:42 UTC+1, Chethan S wrote:
>
> In my case, I have an active GUI session. I'm using it to verify if things 
> are working as expected. 
>
> Another approach which I have tried in the meantime is using psexec which 
> is known to be helpful in such cases, that is to show the GUI. While I was 
> able to launch notepad.exe by using the psexec executable on the client 
> machine, Ansible used to report the operation as failed. .
>
> Don't Ansible users use GUI at any point in time to verify if the 
> operations are running as expected? Are end-to-end operations run in an 
> unattended fashion?
>
> On Tuesday, 5 April 2016 16:16:00 UTC+5:30, J Hawkesworth wrote:
>>
>> I'm fairly certain you won't have a GUI session, so I think windows has 
>> no way of knowing which session to display the notepad user interface in.
>>
>> You might be able to get a session established by setting auto logon (if 
>> you can live with implications of using auto logon) - there's a powershell 
>> script here that can set autologon http://poshcode.org/2982
>>
>> Hope this helps.
>>
>> Jon
>>
>>
>> On Monday, 4 April 2016 16:18:18 UTC+1, Chethan S wrote:
>>>
>>> Ignore those names: I am trying to achieve something else (i.e., turning 
>>> on VMs but I need them to come up in GUI mode. I guess if notepad can come 
>>> up, I will figure out the rest.
>>>
>>> On Monday, 4 April 2016 20:44:27 UTC+5:30, Chethan S wrote:

 I was attempting to launch an application through an Ansible Tower job 
 in a remote Windows VM. I'm logged into the remote PC with the same 
 credentials with which my Ansible playbooks are run. For the sake of 
 simplicity, my playbook is like this - 

 ---
 - name: Register and turn on VMs
   hosts: all

   tasks:
- name: Start VM
  raw: notepad


 I expect the above playbook to launch notepad in GUI mode on the remote 
 Windows PC I'm connected to. However, this only adds up a process for 
 notepad.exe but the GUI doesn't appear. The tower job does not complete 
 either and I end up canceling it. How to ensure that the application 
 launches with a GUI and not as a process?

>>>

-- 
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/61744759-23a2-4b4d-a9b9-ce5d9c8703a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread 'J Hawkesworth' via Ansible Project
Looks like we have crossed messages.

Ansible is pretty flexible, if that suits your need then that's good enough.

If you use a role you can do away with the include_vars but putting your 
serverlist var in a vars/main.yml under your role.  Roles are nice as they 
can magically load lots of stuff like variables - 
see http://docs.ansible.com/ansible/playbooks_roles.html#roles

You might find you want to pass in the list of servers with the -e trick 
too, just depends on how much re-usability you need from your playbook - 
see 
http://docs.ansible.com/ansible/playbooks_variables.html#passing-variables-on-the-command-line

HTH

Jon

-- 
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/d8e6b851-be19-4b9e-9ed8-f684136d712c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread 'J Hawkesworth' via Ansible Project
Mark,

Something like this:

---
 - hosts: 127.0.0.1
   connection: local
   user: root
   sudo: false
   gather_facts: false
   serial: 1
   vars:
 vcenter_hostname: UK.server.local
 esxhost: xxx.xxx.xxx.xxx
 datastore: UK1
 network: Web
 vmcluster: UKCLUSTER
 folder: Utilities
 notes: Created by Ansible

   tasks:
- name: pick up hostnames to create
  include_vars: hostnames.yml
   
- name: Create VM from template
  vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
guest: "{{ list }}"
vm_extra_config:
  notes: "{{ notes }}"
  folder: "{{ folder }}"
from_template: yes
template_src: "{{ vmtemplate }}"
cluster: "{{ vmcluster  }}"
resource_pool: "/Resources"
esxi:
  datacenter: UK
  hostname: "{{ esxhost }}"
   with_items: serverlist
  

-- 
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/67dba27c-45fd-4889-a999-9000a8d39ca3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Mark Matthews
Hi Jon

I will definitely try using your option for extra vars, and see if I can 
get that to work.

Thanks so much for all your help and assistance with this guys!!

Cheers 

On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>
> Hi
>
> Is it at all possible to create multiple VMware VM's using an Ansible 
> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>
> I can see anyway of doing this using the following playbooks, as it keeps 
> failing?
>
> ---
>  - hosts: 127.0.0.1
>connection: local
>user: root
>sudo: false
>gather_facts: false
>serial: 1
>vars:
>  vcenter_hostname: UK.server.local
>  esxhost: xxx.xxx.xxx.xxx
>  datastore: UK1
>  network: Web
>  vmcluster: UKCLUSTER
>  guest_name: server1, server2, server3, server4 
>  folder: Utilities
>  notes: Created by Ansible
>
>tasks:
> - name: Create VM from template
>   vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> guest: "{{ guest_name }}"
> vm_extra_config:
>   notes: "{{ notes }}"
>   folder: "{{ folder }}"
> from_template: yes
> template_src: "{{ vmtemplate }}"
> cluster: "{{ vmcluster  }}"
> resource_pool: "/Resources"
> 
> esxi:
>   datacenter: UK
>   hostname: "{{ esxhost }}"
>
> Any ideas or suggestions would be really appreciated.
>
> Cheers
>
>

-- 
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/a63ca149-31d0-4ca9-a6c1-adce7efbaa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Mark Matthews
Hi guys

Just to let you know, I just worked it out.

I removed the following variable "serverlist: files/hostnames "

And then changed the with_items to the following:

  with_items:
- ans_testserver01
- ans_testserver02

The playbook now creates both VMs (ans_testserver01 and ans_testserver02) 
when it is run.

I dont know if that is the correct way of doing it, but it seems to be 
working for me.



On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>
> Hi
>
> Is it at all possible to create multiple VMware VM's using an Ansible 
> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>
> I can see anyway of doing this using the following playbooks, as it keeps 
> failing?
>
> ---
>  - hosts: 127.0.0.1
>connection: local
>user: root
>sudo: false
>gather_facts: false
>serial: 1
>vars:
>  vcenter_hostname: UK.server.local
>  esxhost: xxx.xxx.xxx.xxx
>  datastore: UK1
>  network: Web
>  vmcluster: UKCLUSTER
>  guest_name: server1, server2, server3, server4 
>  folder: Utilities
>  notes: Created by Ansible
>
>tasks:
> - name: Create VM from template
>   vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> guest: "{{ guest_name }}"
> vm_extra_config:
>   notes: "{{ notes }}"
>   folder: "{{ folder }}"
> from_template: yes
> template_src: "{{ vmtemplate }}"
> cluster: "{{ vmcluster  }}"
> resource_pool: "/Resources"
> 
> esxi:
>   datacenter: UK
>   hostname: "{{ esxhost }}"
>
> Any ideas or suggestions would be really appreciated.
>
> Cheers
>
>

-- 
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/7b36ae4b-84e0-4eb1-8efc-ab93fc091b77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread 'J Hawkesworth' via Ansible Project
Hi Mark,

Quickest way to get going is probably to pass the serverlist file in to 
ansible using extra vars

ansible-playbook your_playbook -e @/full/path/to/your/serverlist

If you don't want to use the -e (extra vars) functionality, then I think 
you need to use include_vars, - see 
 http://docs.ansible.com/ansible/include_vars_module.html 

rather than naming the file you want to load in the vars: section of your 
playbook - vars is just for variables you want to declare within the 
playbook itself.

Jon

On Tuesday, 5 April 2016 15:57:39 UTC+1, Mark Matthews wrote:
>
> Hi Nigel / Jon
>
> I changed the following as suggessted:
>
> guest: "{{ item }}"
>
> What is happening now is when I run the playbook it is creating one VM in 
> vSphere called "files/hostnames"??
>
> So its as if the playbook is looking at, with_items: "{{ serverlist }}", 
> and then seeing the variable, serverlist: files/hostnames, and then 
> creating a VM with that name. Its not looking into the 'hostnames' file and 
> creating the multiple VM's in that file??
>
> Any ideas?
>
> Cheers
> Mark 
>
> On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>>
>> Hi
>>
>> Is it at all possible to create multiple VMware VM's using an Ansible 
>> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>>
>> I can see anyway of doing this using the following playbooks, as it keeps 
>> failing?
>>
>> ---
>>  - hosts: 127.0.0.1
>>connection: local
>>user: root
>>sudo: false
>>gather_facts: false
>>serial: 1
>>vars:
>>  vcenter_hostname: UK.server.local
>>  esxhost: xxx.xxx.xxx.xxx
>>  datastore: UK1
>>  network: Web
>>  vmcluster: UKCLUSTER
>>  guest_name: server1, server2, server3, server4 
>>  folder: Utilities
>>  notes: Created by Ansible
>>
>>tasks:
>> - name: Create VM from template
>>   vsphere_guest:
>> vcenter_hostname: "{{ vcenter_hostname }}"
>> username: "{{ username }}"
>> password: "{{ password }}"
>> guest: "{{ guest_name }}"
>> vm_extra_config:
>>   notes: "{{ notes }}"
>>   folder: "{{ folder }}"
>> from_template: yes
>> template_src: "{{ vmtemplate }}"
>> cluster: "{{ vmcluster  }}"
>> resource_pool: "/Resources"
>> 
>> esxi:
>>   datacenter: UK
>>   hostname: "{{ esxhost }}"
>>
>> Any ideas or suggestions would be really appreciated.
>>
>> Cheers
>>
>>

-- 
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/afbfa7e5-bdb5-4a2d-afb4-6f0061ace874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Mark Matthews
I dont even know if im on the right track here?

Can you guys think of a way that may be easier to do this?

Jon mentioned using loopingbut I have looked at this and have no idea 
how I could apply that to this situation.



On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>
> Hi
>
> Is it at all possible to create multiple VMware VM's using an Ansible 
> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>
> I can see anyway of doing this using the following playbooks, as it keeps 
> failing?
>
> ---
>  - hosts: 127.0.0.1
>connection: local
>user: root
>sudo: false
>gather_facts: false
>serial: 1
>vars:
>  vcenter_hostname: UK.server.local
>  esxhost: xxx.xxx.xxx.xxx
>  datastore: UK1
>  network: Web
>  vmcluster: UKCLUSTER
>  guest_name: server1, server2, server3, server4 
>  folder: Utilities
>  notes: Created by Ansible
>
>tasks:
> - name: Create VM from template
>   vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> guest: "{{ guest_name }}"
> vm_extra_config:
>   notes: "{{ notes }}"
>   folder: "{{ folder }}"
> from_template: yes
> template_src: "{{ vmtemplate }}"
> cluster: "{{ vmcluster  }}"
> resource_pool: "/Resources"
> 
> esxi:
>   datacenter: UK
>   hostname: "{{ esxhost }}"
>
> Any ideas or suggestions would be really appreciated.
>
> Cheers
>
>

-- 
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/ea40ac1d-5455-4ccc-990d-f44d2dc3242b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Mark Matthews
Hi Nigel / Jon

I changed the following as suggessted:

guest: "{{ item }}"

What is happening now is when I run the playbook it is creating one VM in 
vSphere called "files/hostnames"??

So its as if the playbook is looking at, with_items: "{{ serverlist }}", 
and then seeing the variable, serverlist: files/hostnames, and then 
creating a VM with that name. Its not looking into the 'hostnames' file and 
creating the multiple VM's in that file??

Any ideas?

Cheers
Mark 

On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>
> Hi
>
> Is it at all possible to create multiple VMware VM's using an Ansible 
> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>
> I can see anyway of doing this using the following playbooks, as it keeps 
> failing?
>
> ---
>  - hosts: 127.0.0.1
>connection: local
>user: root
>sudo: false
>gather_facts: false
>serial: 1
>vars:
>  vcenter_hostname: UK.server.local
>  esxhost: xxx.xxx.xxx.xxx
>  datastore: UK1
>  network: Web
>  vmcluster: UKCLUSTER
>  guest_name: server1, server2, server3, server4 
>  folder: Utilities
>  notes: Created by Ansible
>
>tasks:
> - name: Create VM from template
>   vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> guest: "{{ guest_name }}"
> vm_extra_config:
>   notes: "{{ notes }}"
>   folder: "{{ folder }}"
> from_template: yes
> template_src: "{{ vmtemplate }}"
> cluster: "{{ vmcluster  }}"
> resource_pool: "/Resources"
> 
> esxi:
>   datacenter: UK
>   hostname: "{{ esxhost }}"
>
> Any ideas or suggestions would be really appreciated.
>
> Cheers
>
>

-- 
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/3104f0cd-e5aa-445c-8010-ed1341cb7255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2016-04-05 Thread Jonathan Davila
You can set the python interpreter as a host or group var. Normally I set 
ansible_python_interpreter: /usr/bin/env python

But in your case it sounds like you'd want a specific path.


On Friday, April 1, 2016 at 7:18:17 PM UTC-4, Osama Shaikh wrote:
>
> Hi Brian, 
>
> Has there been any update on setting ansible_python_interpreter in 
> ansible.cfg. 
>
> Our use case is 
>
> Inside a system user account, we have our own python 2.7.6 version and we 
> want to use ansible_python_interpreter to set our own python path not the 
> one comes by default. 
>
> Regards,
> Osama -
>
> On Thursday, April 23, 2015 at 4:29:30 AM UTC-7, Brian Coca wrote:
>>
>> its still on my 'todo' list, cannot show examples until it transitions 
>> to my 'done' list 
>>
>>
>> -- 
>> 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/de62f689-5107-404b-ba16-f38f79454f88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] HELP: Problem with 'become' and pbrun

2016-04-05 Thread Jonathan Davila
It looks like your recent run found pbrun. I recently worked with a client 
that used pbrun and here's a brief walkthrough of what they did to fix it. 
Also, could you retry via a playbook (not ad hoc) and add - to the run.
>
>
> When you issue a pbrun command such as pbrun /bin/foo/hello –nice –day, PB 
> sets up some variables.
> The first variable is called command and it’s a read-only variable. It’s a 
> string variable, and in the above example would store /bin/foo/hello.
> The next variable is called argv and it too is a read-only variable. This 
> time though, it’s a list and not a string. In the above example would store 
> {‘/bin/foo/hello’, ‘-nice’, ‘-day’}.
>
> So argv[0] is hello, argv[1] is –nice and argv[2] is –day.
>
> The important thing to note is anything and everything passed after 
> command is treated as argv arguments to command. This is why things weren’t 
> working when Ansible was passing multiple commands to a single pbrun 
> command.
>
> PB also has 2 other variables called runcommand and runargv. They are 
> similar to command and argv, and by default contain the same exact values 
> as their counterparts. The difference being is that these variables are 
> modifiable. Their values override the read-only variables if they differ.
>
> What I had to do is this:
> · Change runcommand to /bin/bash
> · runargv[0] automatically changes to bash.
> · Next, I appended runargv by adding –c to it to make it {‘/bin/bash’, 
> ‘-c’}
> · Finally, I appended argv to runargv making runargv be {‘bash’, ‘-c’, 
> ‘/bin/foo/hello’, ‘-nice’, ‘-day’}
> · With all that in place, I allow the command to execute with the new 
> runcommand and runargv in place.


On Monday, April 4, 2016 at 6:30:47 PM UTC-4, phillip@gmail.com wrote:
>
> Interesting. I was not aware of this : <<*Consider adding those 
> environment variables in the .bashrc file. I guess the reason behind this 
> is the login and the non-login shells .Ansible, while executing different 
> tasks reads the parameters from a .bashrc file instead of the bash_profile 
> or the /etc/profile.*>>
>
> so, I tried on just one host to add the absolute path i need in my 
> $HOME/.bashrc, but still it is not working ... I'm not very familiar with 
> pbrun, and I'm not allowed to change the pbrun installation or 
> configuration in any way in this environment.
>
> $  ansible  all -i myhosts2 -m shell -a 'echo $PATH'
> host1.mydom.com | SUCCESS | rc=0 >>
>
> /usr/lib64/qt-3.3/bin:/usr/local/maven-3.2.1/bin:/usr/local/bin:/bin:/usr/bin:/opt/pb/bin
>
> $ ansible all -i myhosts2 -o -m shell -a 'uptime' -b --become-method pbrun
> host1.mydom.com | FAILED! => {"changed": false, "failed": true, 
> "module_stderr": "", "module_stdout": "usage: pbrun [-D level] -h | -K | -k 
> | -V\r\nusage: pbrun -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] 
> [-u user\r\n name|#uid]\r\nusage: pbrun -l[l] [-AknS] [-D 
> level] [-g groupname|#gid] [-p prompt] [-U user\r\n name] [-u 
> user name|#uid] [-g groupname|#gid] [command]\r\nusage: pbrun [-AbEHknPS] 
> [-r role] [-t type] [-C fd] [-D level] [-g\r\n groupname|#gid] 
> [-p prompt] [-u user name|#uid] [-g\r\n groupname|#gid] 
> [VAR=value] [-i|-s] []\r\nusage: pbrun -e [-AknS] [-r role] [-t 
> type] [-C fd] [-D level] [-g\r\n groupname|#gid] [-p prompt] 
> [-u user name|#uid] file ...\r\n", "msg": "MODULE FAILURE", "parsed": false}
>
> $ pbrun -V
> Sudo version 1.8.6p3
> Sudoers policy plugin version 1.8.6p3
> Sudoers file grammar version 42
> Sudoers I/O plugin version 1.8.6p3
>
> On Monday, April 4, 2016 at 12:15:52 PM UTC-6, Benjamin Redling wrote:
>>
>> On 2016-04-04 20:01, phillip@gmail.com wrote: 
>> > So this really seem to be a matter of PATH. -- i'm confused why i'm not 
>> > getting the correct path 
>>
>> login vs non-login shell? 
>>
>>
>> http://stackoverflow.com/questions/27733511/how-to-set-linux-environment-variables-with-ansible
>>  
>>
>> Benjamin 
>> -- 
>> FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html 
>> vox: +49 3641 9 44323 | fax: +49 3641 9 44321 
>>
>

-- 
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/568bca43-7af3-43c1-a02f-4b3f4f66efdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] HELP: Problem with 'become' and pbrun

2016-04-05 Thread Benjamin Redling
On 04/05/2016 00:30, phillip.corch...@gmail.com wrote:
> Interesting. I was not aware of this : <<*Consider adding those environment 
> variables in the .bashrc file. I guess the reason behind this is the login 
> and the non-login shells .Ansible, while executing different tasks reads 
> the parameters from a .bashrc file instead of the bash_profile or the 
> /etc/profile.*>>
> 
> so, I tried on just one host to add the absolute path i need in my 
> $HOME/.bashrc, but still it is not working ... I'm not very familiar with 
> pbrun, and I'm not allowed to change the pbrun installation or 
> configuration in any way in this environment.

Maybe you shouldn't depend on the remote users environment and set the
important stuff explicitly:
http://docs.ansible.com/ansible/playbooks_environment.html

Benjamin
-- 
FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html
vox: +49 3641 9 44323 | fax: +49 3641 9 44321

-- 
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/5703BF1B.3010202%40uni-jena.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Nigel Metheringham
On 5 April 2016 at 12:14:53, Mark Matthews (mdmatth...@gmail.com) wrote:
I have then put the variable "{{ list }}" for the guest option, but how does 
Ansible know to create multiple VM's with those servers names?
I’m not very familiar with that module, but the iterator on a loop (which is 
effectively what you have with the with_items stanza) is “item" and not “list”

So try changing the guest part to:-

guest: “{{ item }”



Nigel.


-- 
[ Nigel Metheringham -- ni...@dotdot.it ]  
[ Ellipsis Intangible Technologies  ]
  

-- 
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/etPan.5703b72d.73fc5fe.5092%40weatherwax.intechnology.co.uk.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Launching applications remotely with GUI

2016-04-05 Thread Chethan S
In my case, I have an active GUI session. I'm using it to verify if things 
are working as expected. 

Another approach which I have tried in the meantime is using psexec which 
is known to be helpful in such cases, that is to show the GUI. While I was 
able to launch notepad.exe by using the psexec executable on the client 
machine, Ansible used to report the operation as failed. .

Don't Ansible users use GUI at any point in time to verify if the 
operations are running as expected? Are end-to-end operations run in an 
unattended fashion?

On Tuesday, 5 April 2016 16:16:00 UTC+5:30, J Hawkesworth wrote:
>
> I'm fairly certain you won't have a GUI session, so I think windows has no 
> way of knowing which session to display the notepad user interface in.
>
> You might be able to get a session established by setting auto logon (if 
> you can live with implications of using auto logon) - there's a powershell 
> script here that can set autologon http://poshcode.org/2982
>
> Hope this helps.
>
> Jon
>
>
> On Monday, 4 April 2016 16:18:18 UTC+1, Chethan S wrote:
>>
>> Ignore those names: I am trying to achieve something else (i.e., turning 
>> on VMs but I need them to come up in GUI mode. I guess if notepad can come 
>> up, I will figure out the rest.
>>
>> On Monday, 4 April 2016 20:44:27 UTC+5:30, Chethan S wrote:
>>>
>>> I was attempting to launch an application through an Ansible Tower job 
>>> in a remote Windows VM. I'm logged into the remote PC with the same 
>>> credentials with which my Ansible playbooks are run. For the sake of 
>>> simplicity, my playbook is like this - 
>>>
>>> ---
>>> - name: Register and turn on VMs
>>>   hosts: all
>>>
>>>   tasks:
>>>- name: Start VM
>>>  raw: notepad
>>>
>>>
>>> I expect the above playbook to launch notepad in GUI mode on the remote 
>>> Windows PC I'm connected to. However, this only adds up a process for 
>>> notepad.exe but the GUI doesn't appear. The tower job does not complete 
>>> either and I end up canceling it. How to ensure that the application 
>>> launches with a GUI and not as a process?
>>>
>>

-- 
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/ac5a898c-ab5f-43cc-a0cd-fe815def07c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Create multiple VMware guests with a Playbook?

2016-04-05 Thread Mark Matthews
Hi Jon 

I am still really battling with this...

I have changed the playbook to the following:

Playbook:
---
 - hosts: 127.0.0.1
   connection: local
   user: root
   sudo: false
   gather_facts: false
   serial: 1
   vars:
 vcenter_hostname: UK.server.local
 esxhost: xxx.xxx.xxx.xxx
 datastore: UK1
 network: Web
 vmcluster: UKCLUSTER
 serverlist: files/hostnames 
 folder: Utilities
 notes: Created by Ansible

   tasks:
- name: Create VM from template
  vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
guest: "{{ list }}"
vm_extra_config:
  notes: "{{ notes }}"
  folder: "{{ folder }}"
from_template: yes
template_src: "{{ vmtemplate }}"
cluster: "{{ vmcluster  }}"
resource_pool: "/Resources"
   
esxi:
  datacenter: UK
  hostname: "{{ esxhost }}"
  
  with_items: "{{ serverlist }}"


As I mentioned, I have created a file called 'hostnames' which is located 
in a sub directory (files) where the playbook is, and have included the vm 
names in that file.

As you can see I have said that the variable {{ serverlist }} needs to look 
at the file path files/hostnames. Is that correct.

And in that hostnames file is the list of servers.
I have then put the variable "{{ list }}" for the guest option, but how 
does Ansible know to create multiple VM's with those servers names?

Im starting to think that this insnt possible and Ansible is not able to do 
this without having to repeat the playbook over and over again for as many 
VM's as you want?

Cheers
Mark


On Thursday, March 10, 2016 at 5:00:18 PM UTC, Mark Matthews wrote:
>
> Hi
>
> Is it at all possible to create multiple VMware VM's using an Ansible 
> playbook? Giving each VM a unique name (server1, server2, server3, server4)?
>
> I can see anyway of doing this using the following playbooks, as it keeps 
> failing?
>
> ---
>  - hosts: 127.0.0.1
>connection: local
>user: root
>sudo: false
>gather_facts: false
>serial: 1
>vars:
>  vcenter_hostname: UK.server.local
>  esxhost: xxx.xxx.xxx.xxx
>  datastore: UK1
>  network: Web
>  vmcluster: UKCLUSTER
>  guest_name: server1, server2, server3, server4 
>  folder: Utilities
>  notes: Created by Ansible
>
>tasks:
> - name: Create VM from template
>   vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> guest: "{{ guest_name }}"
> vm_extra_config:
>   notes: "{{ notes }}"
>   folder: "{{ folder }}"
> from_template: yes
> template_src: "{{ vmtemplate }}"
> cluster: "{{ vmcluster  }}"
> resource_pool: "/Resources"
> 
> esxi:
>   datacenter: UK
>   hostname: "{{ esxhost }}"
>
> Any ideas or suggestions would be really appreciated.
>
> Cheers
>
>

-- 
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/5e6ea70a-62c6-4cbb-91ec-5d06bf83e91b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Launching applications remotely with GUI

2016-04-05 Thread 'J Hawkesworth' via Ansible Project
I'm fairly certain you won't have a GUI session, so I think windows has no 
way of knowing which session to display the notepad user interface in.

You might be able to get a session established by setting auto logon (if 
you can live with implications of using auto logon) - there's a powershell 
script here that can set autologon http://poshcode.org/2982

Hope this helps.

Jon


On Monday, 4 April 2016 16:18:18 UTC+1, Chethan S wrote:
>
> Ignore those names: I am trying to achieve something else (i.e., turning 
> on VMs but I need them to come up in GUI mode. I guess if notepad can come 
> up, I will figure out the rest.
>
> On Monday, 4 April 2016 20:44:27 UTC+5:30, Chethan S wrote:
>>
>> I was attempting to launch an application through an Ansible Tower job in 
>> a remote Windows VM. I'm logged into the remote PC with the same 
>> credentials with which my Ansible playbooks are run. For the sake of 
>> simplicity, my playbook is like this - 
>>
>> ---
>> - name: Register and turn on VMs
>>   hosts: all
>>
>>   tasks:
>>- name: Start VM
>>  raw: notepad
>>
>>
>> I expect the above playbook to launch notepad in GUI mode on the remote 
>> Windows PC I'm connected to. However, this only adds up a process for 
>> notepad.exe but the GUI doesn't appear. The tower job does not complete 
>> either and I end up canceling it. How to ensure that the application 
>> launches with a GUI and not as a process?
>>
>

-- 
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/205f5797-06c8-44cd-b93c-da510864d460%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Vault with Ansible 2.0.0.2 copying encrypted files to server

2016-04-05 Thread Ash Matadeen
Thanks Brian, that all makes sense now!

On Monday, 4 April 2016 14:55:38 UTC+1, Brian Coca wrote:
>
> Currently vault only works for variables, not actual files being copied. 
> There are a couple of pull requests that implement this in the queue.
>
> The way to currently make this work, is to assign the content of the files 
> into a variable that is then put in an encrypted vars file and use the 
> `copy: content='{{varname}}' ...`.
>
>
> --
> 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/18b8071b-af3d-4890-9ce0-d0bcf60a7c43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.