[ansible-devel] Would love to disable lsblk when gathering facts

2016-08-09 Thread Brian Beach
Hi,

I posted a comment to https://github.com/ansible/ansible/issues/10779, but 
it's been closed, and the advice was to post to the group.  So...

At Backblaze, we use Ansible to manage our storage pods.  Each storage pod 
has 45 or 60 data drives, each mounted as an ext4 file system.  Running 
lsblk to get the uuids of the drives frequently takes a full minute, 
especially when the system is busy.  This slows down our deployment process 
quite a bit.

I would love to have an option to disable running lsblk.  I'd be happy to 
implement it, if somebody can point me in the right direction, and give 
some advice about fitting in to the Ansible approach.  Should it be a new 
parameter on the setup module to specifically disable it?  Or perhaps a 
more generic way to list exactly the facts needed, and skip gathering the 
rest?

Thanks,
- BrianB

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-devel] Time frame for end of support for Python-2.4 and Python-2.5 on managed machines

2016-08-09 Thread Toshio Kuratomi
All things must come to an end.  In the case of Ansible's support for
managing hosts whose Python version is 2.4 or 2.5, that ending is within
sight.  Our plan is for the next 2.x release of Ansible after March of 2017
to require Python-2.6 or greater on the managed machines; dropping support
for Python-2.4 and Python-2.5.  Bugfixes for the previous release which are
still supported will continue to keep compatibility with Python-2.4 in the
modules but users should be planning how to transition any of their
machines that are still on Python-2.4 to either a new version of their
OS/distribution or on how they can install and support a newer version of
Python on their older machines.

Thanks,
-Toshio Kuratomi

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: Setup custom facts under Windows Help?

2016-08-09 Thread N. Bailey
Well, we know from this thread that at least one person cares enough about
the full version string to grab it as a custom fact :)

I've never needed Ansible to be aware of the full version so far, but it
does seem like it could be useful. There's a couple of new cmdlets in 5.1,
for example, so having Ansible aware of which revision of a version a
system's running could end up being useful for writing conditionals.

best,

Nikki

On 8 Aug 2016 3:46 p.m., "Trond Hindenes"  wrote:

> Nice find,
> If there's a need for the entire psversion object we can definetely add
> that. Now with all the various psv5 version numbers out there that might
> actually be a very good idea.
>
> On Monday, August 8, 2016 at 3:49:38 PM UTC+2, N. Bailey wrote:
>>
>> Your guess is right, there's no converting to JSON needed. The
>> ansible_psversion variable below is just the output of a plain `
>> $PSVersionTable.PSVersion`, and the module splits it nicely for me:
>>
>> ```
>> "ansible_powershell_version": 4,
>> *"ansible_psversion": {*
>> *"Build": -1,*
>> *"Major": 4,*
>> *"MajorRevision": -1,*
>> *"Minor": 0,*
>> *"MinorRevision": -1,*
>> *"Revision": -1*
>> *},*
>> "ansible_system": "Win32NT",
>> ```
>>
>> The module expects to get an object back from Powershell, and it splits
>> up the elements accordingly:
>>
>>   foreach ($FactsFile in $FactsFiles) {
>>   $out = & $($FactsFile.FullName)
>>   Set-Attr $result.ansible_facts 
>> "ansible_$(($FactsFile.Name).Split('.')[0])"
>> $out
>> [ at https://github.com/ansible/ansible-modules-core/blob/devel/w
>> indows/setup.ps1#L39 ]
>>
>> But when 'ConvertTo-Json' structures it as a single JSON-formatted
>> string, it shrugs and goes 'ok I got a single string back, I'll just
>> display that'.
>>
>> Side note: there is a default fact `ansible_powershell_version` variable,
>> which just gives the major number back. I wonder if it'd be a complex
>> change to make that return a dictionary instead, like
>> ansible_python.version does?
>>
>> Best,
>> Nikki
>>
>> On Friday, 5 August 2016 05:59:20 UTC+1, Bob Tanner wrote:
>>>
>>> Trying to setup custom facts for Windows. In this case, the powershell
>>> info that is shown in $PSVersionTable.
>>>
>>> I have tasks to put it all into place and looking at the - output I
>>> do see the information encoded into setup module output. But's encoded
>>> differently then the native facts, example below highlighted in red.
>>>
>>> ok: [win10fusion] => {
>>> "ansible_facts": {
>>> "ansible_PSVersionTable": "{\"Major\":5,\"Minor\":0,\"Bu
>>> ild\":10586,\"Revision\":494,\"MajorRevision\":0,\"MinorRevi
>>> sion\":494}",
>>> "ansible_architecture": "64-bit",
>>> "ansible_bios_date": "07/01/2015",
>>> "ansible_bios_version": "6.00",
>>> "ansible_date_time": {
>>> "date": "2016-08-04",
>>> "day": "04",
>>> "epoch": "1470354713.15218",
>>> "hour": "23",
>>> "iso8601": "2016-08-05T04:51:53Z",
>>> "iso8601_basic": "20160804T235153120933",
>>> "iso8601_basic_short": "20160804T235153",
>>> "iso8601_micro": "2016-08-05T04:51:53.120933Z",
>>> "minute": "51",
>>> "month": "08",
>>> "second": "53",
>>> "time": "23:51:53",
>>> "tz": "Central Standard Time",
>>> "tz_offset": "-05:00",
>>> "weekday": "Thursday",
>>> "weekday_number": "4",
>>> "weeknumber": "31",
>>> "year": "2016"
>>> }, 
>>>
>>> http://jsonlint.com says the output is valid json, even with the quotes
>>> are being escaped.
>>>
>>> And it's encoded as a string?
>>>
>>> Here is the powershell script that generates the facts.
>>>
>>> $PSVersionTable.PSVersion | ConvertTo-Json -Compress
>>>
>>> I thought ansible_PSVersionTable would be a dictionary, like:
>>>
>>> "ansible_PSVersionTable": {\"Major\":5,\"Minor\":0,\"Bui
>>> ld\":10586,\"Revision\":494,\"MajorRevision\":0,\"MinorRevision\":494}
>>>
>>> The documentation notes says, "... Ansible will take care of this ..."
>>>
>>> http://docs.ansible.com/ansible/setup_module.html
>>>
>>> If the target host is Windows you can now use fact_path. Make sure that
>>> this path exists on the target host. Files in this path MUST be PowerShell
>>> scripts (*.ps1) and their output must be formattable in JSON (Ansible will
>>> take care of this). Test the output of your scripts. This option was added
>>> in Ansible 2.1.
>>>
>>> What does that mean?
>>>
>>> Do I not have to "| ConvertTo-Json" ?
>>>
>>> Thanks.
>>>
>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Development" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/ansible-devel/EOLmxfGLbWs/unsubscribe.
> To unsubscribe from this