[ansible-devel] ansible-base 2.10.0b1 is available

2020-06-17 Thread Matt Davis
Hi all- we're happy to announce a beta release of the new ansible-base 2.10 
package is now available! The ansible-base package consists of only the 
Ansible execution engine, related tools (e.g. ansible-galaxy, 
ansible-test), and a very small set of built-in plugins. Most content that 
was part of Ansible has been split off into individual Ansible Collections, 
which can be installed via the ansible-galaxy tool, or a forthcoming 
Ansible community distribution that will snapshot a set of collections 
roughly equivalent to what was in previous versions of Ansible. Most 
Ansible playbooks and roles will require the installation of some of these 
collections to be able to execute unmodified under ansible-base 2.10.


How to get it
-

$ pip install ansible-base==2.10.0b1 --user

The tar.gz of the release can be found here:

* ansible-base 2.10.0b1
  
https://pypi.python.org/packages/source/a/ansible-base/ansible-base-2.10.0b1.tar.gz
  SHA256: c0cbf9681088bcc10d873502ea7054eaadea5db0bf10ebd4926f908f28868234


What's new in ansible-base 2.10.0b1
---

In addition to numerous bugfixes, most new Ansible features in the 2.10 
release enhance Ansible's support for external plugins via collections. 
They include:

* Collection declaration of supported/tested Ansible versions
* Transparent redirection of plugins formerly included in Ansible to their 
destination collections
* Installation of collections from git repositories
* Various enhancements of test tooling

These features support our goal of allowing Ansible content that was 
written for previous versions of Ansible to run unmodified under 2.10, once 
the necessary collections are installed.


The full changelog is at:

  
https://github.com/ansible/ansible/blob/stable-2.10/changelogs/CHANGELOG-v2.10.rst


Thanks!

The Ansible Core Team

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/1e689c57-2f3a-4372-ba7f-0075307bd9e1o%40googlegroups.com.


Re: [ansible-devel] print volume group with highest number

2020-06-17 Thread Brian Coca
Something like this will sort the keys and use the last one.

- debug: msg={{ansible_lvm.vgs[(ansible_lvm.vgs.keys()|sorted|list)[-1]]}}

-- 
--
Brian Coca

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7ecyFaUQw9yV_y8e%3DO_xwKYF%3D1BR0mJjKrApy6VKqyRNQ%40mail.gmail.com.


Re: [ansible-devel] AnsiballZ overhead when your hosts already have all modules and dependencies

2020-06-17 Thread Matt Martz
As of right now, that idea has been previously rejected.  I implemented
such a change that would only copy the args for the module to the remote
host, but depended on Ansible being installed on the target.

Ultimately this was seen as too fragile, and we have plans to evaluate
other options later.

On Wed, Jun 17, 2020 at 4:09 PM Artem Gromov  wrote:

> Hello,
>
> I am thinking about an idea to put Python and Ansible together with
> modules, plugins, and other dependencies into one static binary executable.
>
> Then I am going to distribute such a binary to all my hosts, including
> Ansible master, and use it as ansible_python_interpreter.
>
> With this approach, all dependencies for the modules will already be on
> managed hosts. Thus I can avoid the AnsiballZ overhead associated with
> compressing a module on Ansible master and transferring it to managed
> hosts. That is, ANSIBALLZ_TEMPLATE will be much simpler and it becomes no
> longer necessary to copy the compressed module.
>
> What is the cleanest way to customize Ansible to implement this idea?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-devel/cd09d5f6-6c42-43f0-9262-bfb8ca1f7244o%40googlegroups.com
> 
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CAD8N0v--%3DpKXQBnN4Y3KVZEX792MZL%3DO39kaEaOBDqoy%3Db_-zg%40mail.gmail.com.


[ansible-devel] AnsiballZ overhead when your hosts already have all modules and dependencies

2020-06-17 Thread Artem Gromov
Hello,

I am thinking about an idea to put Python and Ansible together with 
modules, plugins, and other dependencies into one static binary executable.

Then I am going to distribute such a binary to all my hosts, including 
Ansible master, and use it as ansible_python_interpreter.

With this approach, all dependencies for the modules will already be on 
managed hosts. Thus I can avoid the AnsiballZ overhead associated with 
compressing a module on Ansible master and transferring it to managed 
hosts. That is, ANSIBALLZ_TEMPLATE will be much simpler and it becomes no 
longer necessary to copy the compressed module.

What is the cleanest way to customize Ansible to implement this idea?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/cd09d5f6-6c42-43f0-9262-bfb8ca1f7244o%40googlegroups.com.


Re: [ansible-devel] Re: Create a directory when symlink already exists

2020-06-17 Thread Akansha
Thanks Mike! After discussing the requirement further, I decided to delete
existing symbolic link and proceed. So issue is resolved now.

On Tue, 16 Jun 2020 at 9:05 PM, Mike Sawyers  wrote:

> Didn't realize I didn't reply all when I wrote back to Akansha, so to
> start, here is the additional clearification:
>
> Just to clarify, I want to skip error that occurs because of existing
>> “link”. But error should be thrown if it is caused because of any other
>> reason.
>>
>
> With that said, there are a few ways that I have done this in the past
> ranging from bad to good.  I'll try and cover what I know just to give
> context to the new users to the best I know how to explain it.
>
> My test area in a CentOS 8 docker and ansible 2.9.9:
>
> sh-4.4# ls -la /test
> total 8
> drwxr-xr-x 2 root root 4096 Jun 16 15:01 .
> drwxr-xr-x 1 root root 4096 Jun 16 15:01 ..
> lrwxrwxrwx 1 root root   17 Jun 16 15:01 b -> /usr/tmp
>
> and a playbook of
>
> ---
> - hosts: localhost
>   connection: local
>   tasks:
> - name: create sub directories
>   file: path=/test/{{ item }} state=directory
>   with_items: ['a','b','c']
>
> returns:
>
> TASK [Gathering Facts]
> *
> ok: [localhost]
>
> TASK [create sub directories]
> **
> changed: [localhost] => (item=a)
> ok: [localhost] => (item=b)
> changed: [localhost] => (item=c)
>
> PLAY RECAP
> *
> localhost  : ok=2changed=1unreachable=0failed=
> 0skipped=0rescued=0ignored=0
>
>
> sh-4.4# ls -la /test
> total 16
> drwxr-xr-x 4 root root 4096 Jun 16 15:07 .
> drwxr-xr-x 1 root root 4096 Jun 16 15:01 ..
> drwxr-xr-x 2 root root 4096 Jun 16 15:07 a
> lrwxrwxrwx 1 root root8 Jun 16 15:06 b -> /usr/tmp
> drwxr-xr-x 2 root root 4096 Jun 16 15:07 c
>
> This seems like it just works but maybe my basic play doesn't included
> everything or the test setup is missing something.
>
> To loop the the reported problem of getting an error when a target dir
> already exists as a link to something, I'll try and cover the methods that
> I know of along with some comments on each.
>
> - You could go with a blanket assertion that the job never fails:
>
> ---
> - hosts: localhost
>   connection: local
>   tasks:
> - name: create sub directories
>   file: path=/test/{{ item }} state=directory
>   with_items: ['a','b','c']
>   failed_when: false
>
> This will 'work' but will also mask any other failures that come up for
> any other reason. I only ever use that in very specific cases where I am
> sure beyond doubt that it is fine to never fail.
>
> - You could be selective about failing, but honestly this method is hard
> for me to do cleanly on the fly and always takes me a few attempts to get
> every condition just so. A non-working example would be something like:
>
> ---
> - hosts: localhost
>   connection: local
>   tasks:
> - name: create sub directories
>   file: path=/test/{{ item }} state=directory
>   with_items: ['a','b','c']
>   register: mk_subdir
>   failed_when: (mk_subdir.state is not defined) or (mk_subdir.state is
> defined and mk_subdir.state != 'link')
>
> I didn't run this example since I was unable to duplicate the issue you
> reported having, but it is a pattern of using selective failed_when to
> control failure. This is also in the docs on error handeling.
>
> - Lastly and easiest for me to keep in my headspace you could be selective
> about your list by checking for symlinks first
>
> ---
> - hosts: localhost
>   connection: local
>   vars:
> subdir_list: [ 'a','b','c' ]
>   tasks:
> - name: check sub directories
>   stat:
> path: "/test/{{ item }}"
> get_attributes: no
> get_checksum: no
> get_md5: no
> get_mime: no
>   register: chk_subdirs
>   loop: "{{ subdir_list }}"
>
> - set_fact:
> mkdirs: "{{ subdir_list | difference(item) }}"
>   loop: "{{ chk_subdirs.results | selectattr('stat.islnk') |
> map(attribute='item') | list }}"
>
> - name: create sub directories
>   file:
> path: "/test/{{ item }}"
> state: directory
>   loop: "{{ mkdirs }}"
>
> This first checks each target directory you want to create with stat, then
> any item from that check that is a link is removed from the list of dirs
> that will be created. Lastly I create any directory left in the list. The
> result from this version is
> PLAY [localhost]
> *
>
> TASK [Gathering Facts]
> 

Re: [ansible-devel] ansible-test and testing locally before commit

2020-06-17 Thread Matt Martz
You need to use the path to that file, not just the basename.  If you
install the python argcomplete package, you can tab complete the targets in
ansible-test

On Wed, Jun 17, 2020 at 9:54 AM Sydo Luciani  wrote:

> Getting error running ansible-test against the existing modules in either
> community.aws or amazon.aws:
>
> ansible-test sanity --test yamllint route53_zone.py
> ERROR: Target pattern not matched: route53_zone.py
>
> any idea why ?
>
> Is there an Ansible how to document to setup local test environment like
> using pre-commit, black, flake8 to automate the test procedure locally
> before push or commit ?
>
> Thanks
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-devel/c5af50d0-9c2c-4572-b386-ce498c6107c5o%40googlegroups.com
> 
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CAD8N0v80pK5%3DwaBxvNzNoBhnS7VNfHj%3DoYJwA%3Db%3DrHT4LzakTg%40mail.gmail.com.


[ansible-devel] ansible-test and testing locally before commit

2020-06-17 Thread Sydo Luciani
Getting error running ansible-test against the existing modules in either 
community.aws or amazon.aws:

ansible-test sanity --test yamllint route53_zone.py
ERROR: Target pattern not matched: route53_zone.py

any idea why ?

Is there an Ansible how to document to setup local test environment like 
using pre-commit, black, flake8 to automate the test procedure locally 
before push or commit ? 

Thanks

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/c5af50d0-9c2c-4572-b386-ce498c6107c5o%40googlegroups.com.