profile
viewpoint
David Moreau Simard dmsimard Red Hat Montreal, Canada https://dmsimard.com Principal Community Software Engineer @Ansible

dmsimard/ara-archive 121

This repository is an historical archive of https://github.com/dmsimard/ara, please use https://github.com/openstack/ara instead.

dmsimard/ansible-inventory-puppetdb 55

Leverage Puppet facts and PuppetDB to generate a dynamic Ansible inventory

dmsimard/ansible-tower-cicd 32

A framework for continuous integration and continuous delivery with Ansible Tower.

dmsimard/ansible-sandbox 6

Various tools and sandbox things for developing with Ansible

CentOS/python-cicoclient 3

Client library for the ci.centos.org administrative interface

dmsimard/ara 2

ARA Records Ansible playbooks and makes them easier to understand and troubleshoot. This is the GitHub mirror for https://opendev.org/recordsansible/ara.

dmsimard/ansible 0

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

dmsimard/ansible-ansible 0

Yo dawg, I heard you liked Ansible so I put Ansible in your Ansible.

dmsimard/ansible-include-issue 0

reproducer for an ansible include issue

issue openedansible-community/ara

Missing "which" package in centos8 ara container

What is the issue ?

When pulling latest container image from quay.io , it seems that now one needed package is missing, but needed by ara :

Trying to pull quay.io/recordsansible/ara-api:centos8-pypi-latest...
Getting image source signatures
Copying blob 573ee0ede1f0 done
Copying blob 6d81fbe39a22 done
Copying config 36bbc76c5d done
Writing manifest to image destination
Storing signatures
7b57cd1b8e5037c52b1e2f281508133fb28c00adc6d05997c5a5b8939fc5ad47

What should be happening ?

When calling some maintenance jobs (like pruning DB), it was working before but it doesn't anymore. example :

podman exec -ti --tty ara-api-server  ara playbook prune --days 7 --limit 5000 --confirm 
Traceback (most recent call last):
  File "/usr/local/bin/ara", line 7, in <module>
    from ara.cli.base import main
  File "/usr/local/lib/python3.6/site-packages/ara/cli/base.py", line 9, in <module>
    from cliff.app import App
  File "/usr/local/lib/python3.6/site-packages/cliff/app.py", line 24, in <module>
    import cmd2
  File "/usr/local/lib/python3.6/site-packages/cmd2/__init__.py", line 30, in <module>
    from .cmd2 import Cmd
  File "/usr/local/lib/python3.6/site-packages/cmd2/cmd2.py", line 122, in <module>
    class Cmd(cmd.Cmd):
  File "/usr/local/lib/python3.6/site-packages/cmd2/cmd2.py", line 130, in Cmd
    DEFAULT_EDITOR = utils.find_editor()
  File "/usr/local/lib/python3.6/site-packages/cmd2/utils.py", line 385, in find_editor
    if which(editor):
  File "/usr/local/lib/python3.6/site-packages/cmd2/utils.py", line 201, in which
    exe_path = subprocess.check_output(['which', exe_name], stderr=subprocess.STDOUT).strip()
  File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'which': 'which'
Error: non zero exit code: 1: OCI runtime error

it seems pkg which is missing from base container so ideally just adding it to https://github.com/ansible-community/ara/blob/1b848c7c3617f7163a64113d4e2e0c76230a3e19/contrib/container-images/centos8-pypi.sh#L9 would make it work again.

To confirm, I just added it "manually" in container and then it works :

podman exec -ti --tty ara-api-server dnf install -y which
podman exec -ti --tty ara-api-server  ara playbook prune --days 7 --limit 5000 --confirm

created time in 2 hours

issue commentansible-community/ara

RFC: Providing useful Ansible metrics with ara

actually test if the format of the data is appropriate to be consumed by something like a prometheus exporter

Why not add prometheus metrics exposition into ara itself and reduce the complexity of the stack?

dmsimard

comment created time in 4 days

issue openedansible-community/ara

Resume interrupted playbooks

<!-- Thank you for taking the time to create this issue. Your feedback is appreciated ! --> <!-- Consider reading the documentation on https://ara.readthedocs.io/en/latest/ and joining us on Slack or IRC: https://ara.recordsansible.org/community/ -->

What is the idea ?

Consider a situation in which a playbook abruptly ends either because systemctl reboot was invoked, a transient failure occurred, or some other process halted execution of the playbook. Starting Ansible with the a playbook ID should allow the playbook to resume (noting an interruption event) recording data where it left off.

Logic is contained in v2_playbook_on_start() lines 268:275. If playbook_id present at start (ARA_PLAYBOOK_ID environment variable), then use that otherwise get it from API server.

Additionally, adding a separate permission, api > playbook > can amend playbook would be an additional permission that allows or blocks this behavior. It may be desired as well to block amending failed playbooks leaving the behavior only to incomplete/in-progress ones.

Rationale

My use case is an automated reboot to change mount options/kernel parameters that are mandatory to complete the play. Since a new ID is generated on each execution, a run generates two IDs with the first never reporting as completed.

created time in 5 days

issue commentansible-community/ara

Cannot read property 'map' of undefined on web.demo.recordsansible.org

Would it make sense to just switch to the built in web interface?

phemmer

comment created time in 6 days

issue closedansible-community/ara

Cannot read property 'map' of undefined on web.demo.recordsansible.org

<!-- Thank you for taking the time to create this issue. Your feedback is appreciated ! --> <!-- Consider reading the documentation on https://ara.readthedocs.io/en/latest/ and joining us on Slack or IRC: https://ara.recordsansible.org/community/ -->

What is the issue ?

<!-- Include relevant information to help the community help you. Some examples:

  • the component that you are creating this issue about (api server, api client, web ui, ansible plugins, etc.)
  • linux distribution, version of python, version of ara and ansible
  • how is ara installed (from source, pypi, in a container, etc.) and how you are running it (database backend, wsgi server, etc.)
  • debugging logs by setting ARA_DEBUG to True and ARA_LOG_LEVEL to DEBUG
  • instructions on how to reproduce the issue --> web.demo.recordsansible.org shows errors (Cannot read property 'map' of undefined) when clicking anything.

In addition, the "back" button does not work to get out of the error, instead requiring a "back" + "refresh".

Lastly, I reported the issue about a month ago in the slack chat, but was never acknowledged, and drowned out by all the automated messages. I might suggest a separate channel for the automated messages, or just decommissioning it since it doesn't seem active.

image

What should be happening ?

No error

closed time in 6 days

phemmer

issue commentansible-community/ara

Cannot read property 'map' of undefined on web.demo.recordsansible.org

Ah, ok, thanks for that. I was unaware that the web component was a separate project (was trying to use the demo to do a basic evaluation). I'll go ahead and close this then since that seems like the proper place to track it.

phemmer

comment created time in 6 days

issue openedansible-community/ara

Cannot read property 'map' of undefined on web.demo.recordsansible.org

<!-- Thank you for taking the time to create this issue. Your feedback is appreciated ! --> <!-- Consider reading the documentation on https://ara.readthedocs.io/en/latest/ and joining us on Slack or IRC: https://ara.recordsansible.org/community/ -->

What is the issue ?

<!-- Include relevant information to help the community help you. Some examples:

  • the component that you are creating this issue about (api server, api client, web ui, ansible plugins, etc.)
  • linux distribution, version of python, version of ara and ansible
  • how is ara installed (from source, pypi, in a container, etc.) and how you are running it (database backend, wsgi server, etc.)
  • debugging logs by setting ARA_DEBUG to True and ARA_LOG_LEVEL to DEBUG
  • instructions on how to reproduce the issue --> web.demo.recordsansible.org shows errors (Cannot read property 'map' of undefined) when clicking anything.

In addition, the "back" button does not work to get out of the error, instead requiring a "back" + "refresh".

Lastly, I reported the issue about a month ago in the slack chat, but was never acknowledged, and drowned out by all the automated messages. I might suggest a separate channel for the automated messages, or just decommissioning it since it doesn't seem active.

image

What should be happening ?

No error

created time in 6 days

issue openedansible-community/ara

Use libmariadb-dev instead of libmariadbclient-dev

Hello!

Your current build uses libmariadbclient-dev. This is fine for now, but in the future when you update the Debian/Ubuntu version you are using in the CI, you should change those to libmariadb-dev (or libmariadb-dev-compat if you need to build something old that does not find the correct soname otherwise).

https://github.com/ansible-community/ara/search?q=libmariadbclient-dev

created time in 8 days

issue commentansible-community/ara

NoneType object is not subscriptable

@markfaine I came across this issue while having a similar problem. I was able to get a better view of the connection problem with ara playbook list -v and saw that it was trying to route through our company proxy.

(app-root) sh-4.2$ ara playbook list -v
initialize_app
found extension EntryPoint(name='csv', value='cliff.formatters.commaseparated:CSVLister', group='cliff.formatter.list')
found extension EntryPoint(name='json', value='cliff.formatters.json_format:JSONFormatter', group='cliff.formatter.list')
found extension EntryPoint(name='table', value='cliff.formatters.table:TableFormatter', group='cliff.formatter.list')
found extension EntryPoint(name='value', value='cliff.formatters.value:ValueFormatter', group='cliff.formatter.list')
found extension EntryPoint(name='yaml', value='cliff.formatters.yaml_format:YAMLFormatter', group='cliff.formatter.list')
prepare_to_run_command: PlaybookList
Starting new HTTP connection (1): proxy.example.company.net:80
http://proxy.example.company.net:80 "GET http://ara.myproject.svc:8000/api/v1/playbooks?order=-started&limit=50 HTTP/1.1" 503 2657
Failed to get on /api/v1/playbooks: {'params': {'order': '-started', 'limit': 50}}
HTTP 503: get on /api/v1/playbooks
Failed to get on /api/v1/playbooks: {'params': {'order': '-started', 'limit': 50}}
Expecting value: line 1 column 1 (char 0)
clean_up PlaybookList
got an error: Expecting value: line 1 column 1 (char 0)

Setting the no_proxy environment variable to exclude my ara api server resolve my issue.

(app-root) sh-4.2$ export no_proxy=ara.myproject.svc
(app-root) sh-4.2$ ara playbook list
+----+--------+----------------------------------------------------+-------+---------+-------+-----------------------------+-----------------+
| id | status | path                                               | tasks | results | hosts | started                     | duration        |
+----+--------+----------------------------------------------------+-------+---------+-------+-----------------------------+-----------------+
|  1 | failed | ...jobs_local/playbooks/self_service_prototype.yml |     1 |       1 |     1 | 2020-11-17T17:01:37.272431Z | 00:00:00.562725 |
+----+--------+----------------------------------------------------+-------+---------+-------+-----------------------------+-----------------+

Hopefully this will help others that have a similar problem!

markfaine

comment created time in 13 days

starteddmsimard/python-cephclient

started time in 14 days

issue openedansible-community/ara

Inclusion of ara client into the toolset container

You may want to include ara into the new https://github.com/ansible-community/toolset which bundles Ansible productivity tools.

If you make a PR, I will be more than glad to welcome its addition.

created time in 15 days

push eventansible-community/ara

David Moreau Simard

commit sha 51053c72a6df0748a31a43ea25f7b980a0a732f0

ui: Add play name to task result details Change-Id: I5b1b301a65b63b0c9b2254e36ebc9e780f0f0c08

view details

Zuul

commit sha 1b848c7c3617f7163a64113d4e2e0c76230a3e19

Merge "ui: Add play name to task result details"

view details

push time in 16 days

push eventansible-community/ara

Matt Phillips

commit sha 3e5649b0cd066aadd29f4c119e2e771ea9b34107

callback plugin: use utc timezone for now() rather than a tz-naive stamp. ara drf should do the right thing with timezones based on the now included iso tz. Change-Id: I64e486e9c7d9ebe8ec48f9565ac42b3eecd9a788

view details

push time in 16 days

pull request commentansible-community/ara

callback plugin: use utc timezone for now()

Thank you!

On Fri, Nov 13, 2020 at 8:15 PM David Moreau Simard < notifications@github.com> wrote:

Closed #186 https://github.com/ansible-community/ara/pull/186.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible-community/ara/pull/186#event-3995893331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK2VWZGPF3XUAAXDRLJGDSPXKZLANCNFSM4TRAGVSQ .

mattp-

comment created time in 16 days

pull request commentansible-community/ara

callback plugin: use utc timezone for now()

@dmsimard made the gerrit review over at https://review.opendev.org/#/c/762673/

mattp-

comment created time in 17 days

pull request commentansible-community/ara

callback plugin: use utc timezone for now()

to add to above, ``` [nav] In [3]: datetime.datetime.now().isoformat()
Out[3]: '2020-11-10T14:44:16.463320'

[nav] In [4]: datetime.datetime.now(datetime.timezone.utc).isoformat()
Out[4]: '2020-11-10T19:44:21.711861+00:00'``` the +00:00 offset should always parse to the same epoch regardless of the server settings/how the datetime is parsed; and it should always be 1 to 1 with the localtime based stamp that is getting sent to the server currently. then with USE_TZ/TIME_ZONE timestamps get converted on the way back out again.

mattp-

comment created time in 20 days

pull request commentansible-community/ara

callback plugin: use utc timezone for now()

@dmsimard I'm totally fine if you want to just cherry-pick this, but I can try to sort things out later tonight/tomorrow from a different computer. wrt the django-side settings you are indeed correct, I was playing around with USE_TZ/TIME_ZONE as well in relation to this, I came to the realization its information being lost on the way in from the callback, not a missing server setting. I'm pretty sure this change should be safe in all scenarios, because when specified with timezone.utc, the timestamp becomes unambiguous, when combined with the Datetimefield handling you already set with https://github.com/ansible-community/ara/blob/master/ara/api/models.py#L43 django.utils.timezone here.

mattp-

comment created time in 20 days

PR opened ansible-community/ara

callback plugin: use utc timezone for now()

rather than a tz-naive stamp. ara drf should do the right thing with timezones based on the now included iso tz.

also side note: sorry I know this project is hosted on opendev but I am having some firewall issues with it. are you accepting PR's here? if not I can try to sort out my issues.

Thank you!

+8 -8

0 comment

1 changed file

pr created time in 20 days

push eventansible-community/ara

David Moreau Simard

commit sha e91dba21b3d39e97906cebe9631d45caae1e8e1a

docs: Fix typo for ARA_ARGUMENT_LABELS Change-Id: I7b249c47d1d914a26c7da323e74010d6108b3089

view details

Zuul

commit sha 31a30bfe2f6a33f5736422f2d2c10ab25228666e

Merge "docs: Fix typo for ARA_ARGUMENT_LABELS"

view details

push time in a month

push eventansible-community/ara

David Moreau Simard

commit sha b2cccd019c501842cc2c9cd9ca649e0a75f4aa27

tests: add a tox target to run benchmarks Run benchmark with default settings: tox -e benchmark Run benchmark with specified number of hosts or tasks: tox -e benchmark -- -e benchmark_host_count=50 Change-Id: I295967c6fb39ec5e02a80b863bde4c57fc6f2139

view details

push time in a month

issue commentansible-community/ara

ARA fails when using too many hosts on --limit

Hi David,

Thanks for the quick response and workaround to be used.

Regards,

rntbrgtt

comment created time in a month

issue commentansible-community/ara

ARA fails when using too many hosts on --limit

Hi David,

Thanks for your reply.

This is an old run so I dont have -vvv to show.

xxx:~/xxx$ ansible-playbook playbooks/xxx.yml --check --diff -l 'xxx-1,xxx-2,xxx-3,xxx-4,xxx-5,xxx-6,xxx-7,xxx-8,xxx-9,xxx-10,xxx-11,xxx-12,xxx-13,xxx-14,xxx-15,xxx-16,17,18,19,20,!21,!22,!23,!24,!25,!26,!27,!28' -b

PLAY [Catch-all playbook] *******************************************************************************************************************************************************************************************************************
Failed to patch on /api/v1/playbooks/2175: {'labels': ['check:True', 'tags:all', 'subset:xxx-1,xxx-2,xxx-3,xxx-4,xxx-5,xxx-6,xxx-7,xxx-8,xxx-9,xxx-10,xxx-11,xxx-12,xxx-13,xxx-14,xxx-15,xxx-16,17,18,19,20,!21,!22,!23,!24,!25,!26,!27,!28']}
Failed to patch on /api/v1/playbooks/2175: {'labels': ['check:True', 'tags:all', 'subset:xxx-1,xxx-2,xxx-3,xxx-4,xxx-5,xxx-6,xxx-7,xxx-8,xxx-9,xxx-10,xxx-11,xxx-12,xxx-13,xxx-14,xxx-15,xxx-16,17,18,19,20,!21,!22,!23,!24,!25,!26,!27,!28']}
[WARNING]: Failure using method (v2_playbook_on_play_start) in callback plugin (<ansible.plugins.callback.ara_default.CallbackModule object at 0x7f1ace7322e8>): Expecting value: line 1 column 1 (char 0)
[WARNING]: Failure using method (v2_playbook_on_task_start) in callback plugin (<ansible.plugins.callback.ara_default.CallbackModule object at 0x7f1ace7322e8>): 'NoneType' object is not subscriptable
[WARNING]: Failure using method (v2_runner_on_skipped) in callback plugin (<ansible.plugins.callback.ara_default.CallbackModule object at 0x7f1ace7322e8>): 'NoneType' object is not subscriptable

I hope that helps.

Regards,

rntbrgtt

comment created time in a month

issue openedansible-community/ara

ARA fails when using too many hosts on --limit

ARA 1.5.1 Installed from pip Virtual Env Debian GNU/Linux 10 (buster) Mysql Database

What is the issue ?

Whenever we run ansible with a lot of hosts on "--limit" there will be an error message and the output will not go to the DB.

To reproduce it simply run any playbook and add a lot of hosts on it's limit.

For example: ansible-playbook plabook.yml --limit 'A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z'

What should be happening ?

ARA should work and execution output should go to the database.

created time in a month

issue commentansible-community/ara

Measuring and improving callback plugin performance

FWIS, I'd think comparing ARA with a minimal callback would be more useful than a 'functionally empty' callback.

Having a zero functionality measurement is the base line. There is no way to make Ara better. I think it's fairly important to know this number to be able to compare the current status. This is especially important if we consider that the basic Ansible run is slow compared to, for example, running with Mitogen.

I'm not sure how I can run the benchmark tests. Can you please create a script or tox env that does it?

their "parent" relationship

Yes, this is exactly what I tried to explain. This relationship is different for the client and the server and both entities can create a consistent view of the world but this doesn't mean that the client has to use the same model as the server. The only thing that has to be consistent is the order of events from the client. I was trying to find something similar for this operational mode and I think the Elasticsearch Bulk APIs are a good example. In the bulk request, individual operations are sent as a package. The Ara client could send its events the same way. I'm not knowledgeable in Django but may try to tweak with the setup a bit.

dmsimard

comment created time in a month

issue commentansible-community/ara

Measuring and improving callback plugin performance

You understand correctly. I've benchmarked "no callback enabled" and "ara callback enabled" but we could argue that there's another delta to measure: what's the overhead cost of a callback that does nothing (or just a print?) so we could have the true overhead of the ara callback.

For what it's worth, Zuul has a callback plugin https://opendev.org/zuul/zuul/src/branch/master/zuul/ansible/base/callback/zuul_json.py which saves data into a local json file and there's no database. It could be interesting to compare :)

FWIS, I'd think comparing ARA with a minimal callback would be more useful than a 'functionally empty' callback.

dmsimard

comment created time in a month

issue commentansible-community/ara

Measuring and improving callback plugin performance

Very interesting read and promising results. I may have a few ideas how the improvement could proceed.

How much is the minimal overhead?

For me, it seems to be a missing piece of the puzzle. You can scrape away as much of the additional operations as possible but what is the minimum overhead of having the callback enabled. That is, something that collects all the data from Ansible and then discards it. It would be really useful to see how much this is compared to the pure Ansible run as this could be base optimal state that we are trying to reach.

Synchronous calls

One of the preventors of things going as fast as possible is the fact that some API calls are made synchronously (as far as I understood) I guess these are necessary because the server is providing some unique IDs. I'm talking from gut feeling from now on.

So if we could turn the updates toward the server a single direction flow of events, then all communication could essentially be asynchronous. In order to achieve this, the client must provide/generate all IDs for the events. The events can then be streamed to the server and it can process them in order.

Once I had a similar problem where I had a high performance task framework and the state of the tasks had to be represented in a job hierarchy. Originally, the comms was synchronous and it kept the task framework from performing adequately. The only thing I actually needed on the tasks side from the server was the job ID. I created the job and then used the returned ID to send updates to that. But I figured out that this ID can actually be anything, as long as it's unique in the event stream from the client. So I changed the logic so that each task would be assigned a simple 32 bit integer ID that is unique for that client and every event from that task would refer to this ID. Then the events were streamed to the job server where the server took all events in order and it knew that each event from a given client with a given task ID must be applied on the same job object.

I hope this makes sense.

If I understand right, then this and this are the code that need to run synchronously. By applying the logic I described, these could be turned into async calls/events, too.

dmsimard

comment created time in a month

issue closedansible-community/ara

Environment variable for api_server

In the ansible.cfg in the ara section there is: api_server = http://api.example.org Can this be set with an environment variable? I have a situation where the value isn't static or always known in advance. ARA is running in a docker swarm and apparently http://tasks.ara_ara:8000 is not allowed.

closed time in a month

markfaine

issue commentansible-community/ara

Environment variable for api_server

Sorry, I think this is a different information.

markfaine

comment created time in a month

issue commentansible-community/ara

Environment variable for api_server

The available configuration settings and corresponding environment variables are documented at https://ara.readthedocs.io/en/latest/ansible-plugins-and-use-cases.html#ara-default-callback-recording-playbooks-from-ansible Yes, I know. I looked. That's why I'm submitting the issue. I didn't see anything.

markfaine

comment created time in a month

issue commentansible-community/ara

Environment variable for api_server

The available configuration settings and corresponding environment variables are documented at https://ara.readthedocs.io/en/latest/ansible-plugins-and-use-cases.html#ara-default-callback-recording-playbooks-from-ansible

markfaine

comment created time in a month

more