added mariadb to docker stack
Signed-off-by: Marc Ahlgrim <marc@onemarcfifty.com>
This commit is contained in:
parent
36dddd6f03
commit
0c87745fb4
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.env
|
||||||
@ -5,17 +5,29 @@ FROM rundeck/rundeck:4.4.0
|
|||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
RUN apt-get -y update && \
|
RUN apt-get -y update && \
|
||||||
apt-get -y install \
|
apt-get -y install \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
python3-pip
|
python3-pip \
|
||||||
|
sudo \
|
||||||
|
wget \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
nmap
|
||||||
|
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
RUN pip install ansible
|
RUN pip install ansible
|
||||||
|
|
||||||
|
RUN wget https://github.com/coder/code-server/releases/download/v4.6.0/code-server_4.6.0_amd64.deb
|
||||||
|
RUN apt -y install ./code-server_4.6.0_amd64.deb
|
||||||
|
|
||||||
USER rundeck
|
USER rundeck
|
||||||
|
|
||||||
|
# now make sure the vscode server gets started at runtime
|
||||||
|
RUN echo 'export PASSWORD=$VSCODE_PASSWORD' >docker-lib/includes/120_vscode.sh
|
||||||
|
RUN echo 'pidof node || /usr/bin/code-server --host 0.0.0.0 &' >>docker-lib/includes/120_vscode.sh
|
||||||
|
RUN chmod 755 docker-lib/includes/120_vscode.sh
|
||||||
|
|
||||||
#VOLUME ["/home/rundeck/server/data"]
|
#VOLUME ["/home/rundeck/server/data"]
|
||||||
|
|
||||||
|
|||||||
@ -5,10 +5,23 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
rundeck:
|
rundeck:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
container_name: rundeck
|
container_name: rundeck
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
environment:
|
links:
|
||||||
RUNDECK_GRAILS_URL: http://127.0.0.1:4440
|
- mariadb
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
env_file:
|
||||||
|
.env
|
||||||
ports:
|
ports:
|
||||||
- 4440:4440
|
- 4440:4440
|
||||||
|
- 8080:8080
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.5.8
|
||||||
|
container_name: mariadb
|
||||||
|
restart: on-failure:5
|
||||||
|
env_file:
|
||||||
|
.env
|
||||||
|
|
||||||
|
|||||||
36
ansible-rundeck-docker/pre-install.sh
Executable file
36
ansible-rundeck-docker/pre-install.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this script creates random passwords
|
||||||
|
# and updates the .env file
|
||||||
|
|
||||||
|
# create a new environment file
|
||||||
|
|
||||||
|
# random password for Database connection
|
||||||
|
RANDOMPASSWORD=`date +%s | sha256sum | base64 | head -c 32`
|
||||||
|
|
||||||
|
# the hostname which we can use in order to access rundeck
|
||||||
|
# from the outside.
|
||||||
|
# we set this to the hostname of the docker host
|
||||||
|
GRAILS_HOST_NAME=`hostname`
|
||||||
|
|
||||||
|
(cat >.env) <<EOF
|
||||||
|
# a random password for database connection
|
||||||
|
RUNDECK_DATABASE_USERNAME=rundeck
|
||||||
|
RUNDECK_DATABASE_PASSWORD=$RANDOMPASSWORD
|
||||||
|
RUNDECK_DATABASE_DRIVER=org.mariadb.jdbc.Driver
|
||||||
|
RUNDECK_GRAILS_URL=http://${GRAILS_HOST_NAME}:4440
|
||||||
|
RUNDECK_DATABASE_URL=jdbc:mysql://mariadb/rundeck?autoReconnect=true&useSSL=false
|
||||||
|
MARIADB_DATABASE=rundeck
|
||||||
|
MYSQL_DATABASE=rundeck
|
||||||
|
MARIADB_RANDOM_ROOT_PASSWORD=yes
|
||||||
|
MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||||
|
#MARIADB_MYSQL_LOCALHOST_USER=rundeck
|
||||||
|
#MARIADB_MYSQL_LOCALHOST_GRANTS=all
|
||||||
|
MARIADB_USER=rundeck
|
||||||
|
MARIADB_PASSWORD=$RANDOMPASSWORD
|
||||||
|
MYSQL_USER=rundeck
|
||||||
|
MYSQL_PASSWORD=$RANDOMPASSWORD
|
||||||
|
VSCODE_PASSWORD=onemarcfifty
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RANDOMPASSWORD="nothing here"
|
||||||
@ -46,7 +46,7 @@
|
|||||||
- name: Add a new user named ansiblessh
|
- name: Add a new user named ansiblessh
|
||||||
user:
|
user:
|
||||||
name=ansiblessh
|
name=ansiblessh
|
||||||
password={{ ansiblessh_password }}
|
password={{ ansible_user_password }}
|
||||||
|
|
||||||
- name: Add ansiblessh user to the sudoers
|
- name: Add ansiblessh user to the sudoers
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user