Skip to content

Instantly share code, notes, and snippets.

David Moreau Simard dmsimard

View GitHub Profile
View ara-simplified.spec
%global srcname ara
Name: %{srcname}
Version: 1.3.2
Release: 1%{?dist}
Summary: ARA Records Ansible playbooks and makes them easier to understand and troubleshoot
License: GPLv3
# Proof of concept of running playbooks in AWX and recording them in ARA
# From a vanilla CentOS8 image:
# Add local bin directory to PATH so we can use things installed with "pip install --user"
export PATH=$PATH:~/.local/bin
dnf -y update
# Install Ansible and Python3
dmsimard /
Created Sep 9, 2019
http client test
#!/usr/bin/env python3
import json
# Import the client
from ara.clients.http import AraHttpClient
# Instanciate the HTTP client with an endpoint where an API server is listening
client = AraHttpClient(endpoint="")
import json
import re
from urllib import parse as urlparse
import requests
def _image_tag_from_url(image_url):
if '@' in image_url.path:
dmsimard /
Created Jun 5, 2019
ara with ansible-runner
#!/usr/bin/env python3
# Proof of concept ara with ansible-runner
# Requires
import ansible_runner
import os
from ara.setup import callback_plugins
- name: Test for ansible-runner
View ansible-tests-with-ara.patch
[root@bastion ansible]# cat 0001-run-tests-with-ara.patch
From af24cfe08bc33a2a63fd2ccc6736f35fd22cdc59 Mon Sep 17 00:00:00 2001
From: root <root@bastion.novalocal>
Date: Fri, 31 May 2019 12:39:49 +0000
Subject: [PATCH] run tests with ara
test/integration/integration.cfg | 5 +++++
test/integration/targets/ping/tasks/main.yml | 12 ++++++++++++
#!/usr/bin/env python
# Copyright Red Hat, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
View ara_playbook_label.yaml
# Would create the label if it doesn't exist
# Description is optional but can be provided
# Appends the label to playbook.labels for state.present
# Removes the label from playbook.labels for state.absent
- name: Label this playbook
name: "{{ item }}"
state: present
- pre-run
View ara_api.yaml
- name: Get playbooks
# This doesn't actually need to be specified, the module can pick it up from the callback config
# api_server:
action: get
endpoint: /api/v1/playbooks
status: failed
register: failed_playbooks
You can’t perform that action at this time.