{"id":42748227,"url":"https://github.com/ansible-middleware/flange-demo","last_synced_at":"2026-01-29T19:24:59.704Z","repository":{"id":37826658,"uuid":"257203467","full_name":"ansible-middleware/flange-demo","owner":"ansible-middleware","description":"A small demo of setting up a Wildfly cluster on a single node, using Ansible (and the JCliff Ansible Collections)","archived":false,"fork":false,"pushed_at":"2024-08-05T15:01:06.000Z","size":315,"stargazers_count":5,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-05T17:29:37.925Z","etag":null,"topics":["ansible","demo"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansible-middleware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-20T07:24:33.000Z","updated_at":"2024-08-05T15:01:11.000Z","dependencies_parsed_at":"2024-07-25T06:49:43.008Z","dependency_job_id":"3a45deb7-d8ce-4ec2-bd0c-0599e2de31e2","html_url":"https://github.com/ansible-middleware/flange-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ansible-middleware/flange-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-middleware%2Fflange-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-middleware%2Fflange-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-middleware%2Fflange-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-middleware%2Fflange-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansible-middleware","download_url":"https://codeload.github.com/ansible-middleware/flange-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-middleware%2Fflange-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28883087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T16:41:59.663Z","status":"ssl_error","status_checked_at":"2026-01-29T16:39:39.641Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","demo"],"created_at":"2026-01-29T19:24:58.970Z","updated_at":"2026-01-29T19:24:59.682Z","avatar_url":"https://github.com/ansible-middleware.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flange-demo: middleware integration\n===================================\n[![CI](https://github.com/ansible-middleware/flange-demo/actions/workflows/ci.yml/badge.svg)](https://github.com/ansible-middleware/flange-demo/actions/workflows/ci.yml)\n\nThis repository contains a set of Ansible based roles and playbooks to demonstrate the integration between a [Wildfly](https://wildfly.org/) cluster with an application deployed and secured using [Keycloak](https://www.keycloak.org/), and demonstrating integration with postgresql and datagrid. \n\n## How to use devfile to setup your dev environment\n\nTo use the `devfile.yaml` and set up your development environment with OpenShift Dev Spaces or Visual Studio Code, follow these steps:\n\n1. **Clone the Repository**\n\n    ```sh\n    git clone https://github.com/ansible-middleware/flange-demo.git\n    cd flange-demo\n    ```\n2. **Install OpenShift Dev Spaces or Visual Studio Code**\n\n    - Download and install [OpenShift Dev Spaces](https://access.redhat.com/products/red-hat-openshift-dev-spaces), else you can directly use Dev Spaces from [Red Hat Developer Snadbox](https://console.redhat.com/openshift/sandbox) as well.\n    - Download and install [Visual Studio Code](https://code.visualstudio.com/).\n\n3. 1. **Open the Red Hat Dev Spaces(If you Red Hat subscription use this)**\n\n    - Select `Red Hat Dev Spaces` option from above provided Red hat Developer Sandbox link.\n    - Put [flange-demo](https://github.com/ansible-middleware/flange-demo.git) Git repo URL in the `Import from Git` option and click on `Create \u0026 Open`.\n\n    2. **Open the Project in Visual Studio Code**\n\n    - Open Visual Studio Code.\n    - Open the project folder you cloned: `File \u003e Open Folder...` and select the project directory.\n    - Once the folder is open, click on the green button in the bottom-left corner (`\u003e\u003c`) and select `New Dev Container`.\n\nBoth options will use the `devfile.yaml` to configure and start the development container. You can then start coding and run the playbook within this environment, without worrying about the prerequisite setup.\n\n## Set up\n\nThe following sections describe the steps necessary to prepare your machine for execution\n\n### Integration\n\nFirst of all, you'll need to install the collection from middleware_automation and their dependencies:\n\n- [Wildfly](https://github.com/middleware_automation/wildfly)\n- [Keycloak](https://github.com/middleware_automation/keycloak)\n- [Infinispan](https://github.com/middleware_automation/infinispan)\n\nInstall via:\n\n    $ pip install -r requirements.txt\n    $ ansible-galaxy collection install -r requirements.yml\n\n\n### Ansible Inventory\n\nAnsible groups are used to define the Keycloak and Wildfly instances. Configure these groups in the [hosts](inventory/hosts) file similar to the following:\n\n```\n[flange]\n\n[wildfly]\n192.168.22.4\n\n[keycloak]\n192.168.22.5\n\n[flange:children]\nwildfly\nkeycloak\n```\n\n## Execution\n\nCreate a `rhn-creds.yml` file containing your RHN account credentials, needed to download packages, as follows:\n\n```\nrhn_username: '...'\nrhn_password: '...'\n```\n\nThat's all! You can now run the playbook to set up the demo:\n\n    $ ansible-playbook -e @rhn-creds.yml -i inventory/demo playbooks/demo.yml\n\n### Execution in a podman container\n\nThis will create a podman container based on ubi8.4, attached to subscription manager during the build phase, and deploy the demo ansible playbook using a local transport.\n\nTo create the oci image, use the provided Dockerfile:\n\n```\nFROM registry.access.redhat.com/ubi8/ubi\n\nRUN subscription-manager register --username='...' --password='...' --name=ubi8-ansible-4\nRUN subscription-manager attach --auto\nRUN subscription-manager attach --pool=\"8a85f98260c27fc50160c323247e39e0\"\nRUN subscription-manager repos --enable ansible-2.9-for-rhel-8-x86_64-rpms\nRUN yum install -y ansible\nRUN yum -y install systemd; yum clean all; (cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); rm -f /lib/systemd/system/multi-user.target.wants/; rm -f /etc/systemd/system/.wants/; rm -f /lib/systemd/system/local-fs.target.wants/; rm -f /lib/systemd/system/sockets.target.wants/*udev; rm -f /lib/systemd/system/sockets.target.wants/initctl; rm -f /lib/systemd/system/basic.target.wants/; rm -f /lib/systemd/system/anaconda.target.wants/;\nVOLUME [ \"/sys/fs/cgroup\" ]\nCMD [\"/usr/sbin/init\"]\n```\n\nand run:\n\n    $ subscription-manager refresh\n    $ podman build -f podman/Dockerfile-podman\n    cafebabe\n    $ podman tag cafebabe ubi8-ansible:latest\n\nThen running with the provided podrun script:\n\n```\n#!/bin/bash\n\nreadonly DOCKER_IMAGE=${DOCKER_IMAGE:-'ubi8-ansible'}\nreadonly DOCKER_NAME=${1:-'demo'}\n\nif [ ! \"$(docker ps -q -f name=${DOCKER_NAME})\" ]; then\n  podman run  -dit --systemd=true --privileged=true  \\\n       --rm --name \"${DOCKER_NAME}\" --workdir /work -v $(pwd):/work:rw \\\n       \"${DOCKER_IMAGE}\" \\\n       /sbin/init\nfi\npodman exec -ti \"${DOCKER_NAME}\" /bin/bash\n```\n\nNow set ansible to work with local connections in ansible.cfg:\n\n```\n[defaults]\ntransport = local\n...\n```\n\nand are ready to run:\n\n    $ podrun demo\n    -\u003e $ ANSIBLE_CONFIG=podman/ansible-local.cfg ansible-playbook -i inventory/demo -e @rhn-creds.yml playbooks/demo.yml\n\n\n### Execution in multiple podman containers\n\nYou'll need rootful podman with podman-plugins for intra-container networking, and execute ansible leveraging the [podman transport](https://docs.ansible.com/ansible/2.9/plugins/connection/podman.html).\nThe host must be RHEL8.4 with working subscription, dnf in containers will have subscription-manager work in 'container mode', so ensure to enable ansible repository in the host:\n\n    $ subscription-manager repos --enable ansible-2.9-for-rhel-8-x86_64-rpms\n\nSetup ansible.cfg with the following (`interpreter_python` is also important because of this [bug](https://github.com/ansible/ansible/issues/71668)):\n\n```\n[defaults]\nhost_key_checking = False\ninterpreter_python = auto\ntransport = podman\nremote_user = root\n```\n\nCreate a pythonized image for containers based on ubi8.4, using the provided Dockerfile:\n\n```\n$ podman build -f podman/Dockerfile-podmanbase\n505e98b27d0\n$ podman tag 505e98b27d0 ubi8/ubi-ansible-flange-demo:latest\n```\n\nMake sure the podman network has the dnsname plugin enabled:\n\n```\n$ podman network ls\nNETWORK ID    NAME        VERSION     PLUGINS\n2f259bab93aa  podman      0.4.0       bridge,portmap,firewall,tuning,dnsname\n```\n\nNow you can startup the containers, using the [provided script (wip)](ansible-demo-podman.sh), which reads the inventory and names each one accordingly\n\n    $ podman run --name=keycloak-0 --systemd=true  --workdir /work -v $(pwd):/work:rw  -dit localhost/ubi8/ubi-ansible-flange-demo:latest /sbin/init\n    [...]\n\nAnd finally:\n\n    $ ANSIBLE_CONFIG=podman/ansible-podman.cfg ansible-playbook -e @rhn-creds.yml -i inventory/demo playbooks/demo.yml\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-middleware%2Fflange-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansible-middleware%2Fflange-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-middleware%2Fflange-demo/lists"}