Skip to content

Commit

Permalink
added EE to codeready ability
Browse files Browse the repository at this point in the history
  • Loading branch information
adworjan committed Dec 1, 2023
1 parent 9a4e6d6 commit 599d0a9
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 82 deletions.
37 changes: 0 additions & 37 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,3 @@ components:
cpuRequest: 250m
cpuLimit: 2000m
name: ansible
# commands:
# - exec:
# commandLine: molecule lint
# component: ansible
# label: 'Molecule: Lint'
# workingDir: /projects/ansible-role-tower-config
# id: molecule-lint
# - exec:
# commandLine: yamllint .
# component: ansible
# label: 'Yamllint: workshops'
# workingDir: /projects/workshops
# id: yamllint-workshops
# - exec:
# commandLine: ansible-playbook provision_lab.yml -e @sample_workshops/sample-vars-rhel.yml
# component: ansible
# label: 'Workshop: RHEL'
# workingDir: /projects/workshops/provisioner
# id: workshop-rhel
# - exec:
# commandLine: ansible-playbook provision_lab.yml -e @sample_workshops/sample-vars-networking.yml
# component: ansible
# label: 'Workshop: Networking'
# workingDir: /projects/workshops/provisioner
# id: workshop-networking
# - exec:
# commandLine: ansible-playbook provision_lab.yml -e @sample_workshops/sample-vars-security.yml
# component: ansible
# label: 'Workshop: Security'
# workingDir: /projects/workshops/provisioner
# id: workshop-security
# - exec:
# commandLine: ansible-playbook provision_lab.yml -e @sample_workshops/sample-vars-f5.yml
# component: ansible
# label: 'Workshop: F5'
# workingDir: /projects/workshops/provisioner
# id: workshop-f
11 changes: 11 additions & 0 deletions devspaces/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
PROMPT_COMMAND=__prompt_command

__prompt_command() {
local RC="$?"
RC_MSG=""
if [ "$RC" != 0 ]; then
RC_MSG="\[$(tput sgr0)\]\[\033[38;5;9m\]$RC\[$(tput sgr0)\]"
fi
PS1="\[\033[38;5;56m\]\u\[$(tput sgr0)\]\[\033[38;5;8m\]@\[$(tput sgr0)\]\[\033[38;5;130m\]${CONTAINER_NAME}\[$(tput sgr0)\]: \[$(tput sgr0)\]\[\033[38;5;25m\]\w\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;28m\]\$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')\[$(tput sgr0)\]$RC_MSG\n\\$ \[$(tput sgr0)\]"
}
30 changes: 30 additions & 0 deletions devspaces/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# replace with your EE
ARG EE_BASE_IMAGE=towerpah.shadowman.dev/shadowmanee:latest
FROM $EE_BASE_IMAGE

LABEL ansible-execution-environment=true

USER root
WORKDIR /tmp

COPY shells /etc/shells
COPY .bashrc /home/runner/.bashrc

RUN printf "export CONTAINER_NAME=$ansibleee\n" >> /home/runner/.bashrc

RUN for dir in \
/home/runner \
/home/runner/.ansible \
/home/runner/.ansible/tmp \
/runner \
/home/runner \
/runner/env \
/runner/inventory \
/runner/project \
/runner/artifacts ; \
do mkdir -m 0775 -p $dir ; chmod -R g+rwx $dir ; chgrp -R root $dir ; done && \
for file in \
/home/runner/.ansible/galaxy_token \
/etc/passwd \
/etc/group ; \
do touch $file ; chmod g+rw $file ; chgrp root $file ; done
6 changes: 6 additions & 0 deletions devspaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Modifying permissions for Ansible-Lint and bash to work in CodeReady workspaces
Run

podman build --tag YOURIMAGENAMEANDTAG -f Containerfile

to modify your existing EE to work in CodeReady workspaces. Then push the image to your container registry. Utilize the devfile.yaml and adjust for your registry and image
4 changes: 4 additions & 0 deletions devspaces/shells
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/bin/bash
/usr/bin/bash
/bin/sh
/usr/bin/sh
10 changes: 0 additions & 10 deletions support/ansible-udi/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions support/ansible-udi/README.txt

This file was deleted.

15 changes: 0 additions & 15 deletions support/ansible-udi/build.sh

This file was deleted.

0 comments on commit 599d0a9

Please sign in to comment.