Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CentOS based minion to environment in docker #124 #125

Merged
merged 8 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
Versions
--------
These docker images are build with Ubuntu 18.04 (bionic) and Debian 9 (stretch). They use the following repositories to install saltstack:
- https://repo.saltstack.com/apt/debian/9/amd64/latest
- http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest
These docker images are build with:
- CentOS 7 (7.6.1810)
- Debian 9 (stretch)
- Ubuntu 18.04 (bionic)

Version of all salt packages installed: *2018.3.2+ds-1*
They use the following repositories to install saltstack:
- https://repo.saltstack.com/py3/redhat/7/x86_64/archive/${SALT_VERSION}
- https://repo.saltstack.com/apt/debian/9/amd64/archive/${SALT_VERSION}
- http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION}

Version of all salt packages installed: *SALT_VERSION=2018.3.3*

Docker images
-------------
Commands used to build these docker images::
Commands used to build these docker images (you must be inside `dockerfiles` folder):

## salt master based on ubuntu
```
docker build -f dockerfile-saltmaster --tag erwindon/saltgui-saltmaster:2018.3.3 .
```

## salt minion based on centos
```
docker build -f dockerfile-saltminion-centos --tag erwindon/saltgui-saltminion-centos:2018.3.3 .
```

## salt minion based on debian
```
docker build -f dockerfile-saltminion-debian --tag erwindon/saltgui-saltminion-debian:2018.3.3 .
```

docker build -f dockerfiles/dockerfile-saltmaster -t maerteijn/saltgui-saltmaster .
docker build -f dockerfiles/dockerfile-saltminion-debian -t maerteijn/saltgui-saltminion-debian .
docker build -f dockerfiles/dockerfile-saltminion-ubuntu -t maerteijn/saltgui-saltminion-ubuntu .
## salt minion based on ubuntu
```
docker build -f dockerfile-saltminion-ubuntu --tag erwindon/saltgui-saltminion-ubuntu:2018.3.3 .
```
16 changes: 10 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
saltmaster-local:
image: maerteijn/saltgui-saltmaster
image: erwindon/saltgui-saltmaster:2018.3.3
hostname: saltmaster-local
ports:
- 4505:4505
Expand All @@ -11,20 +11,24 @@ services:
- ./srv/:/srv/
- ./conf/master:/etc/salt/master
- ../saltgui:/saltgui
entrypoint: /usr/bin/supervisord

saltminion-ubuntu:
image: maerteijn/saltgui-saltminion-ubuntu
image: erwindon/saltgui-saltminion-ubuntu:2018.3.3
hostname: saltminion-ubuntu
depends_on:
- saltmaster-local
restart: on-failure
command: /usr/bin/salt-minion

saltminion-debian:
image: maerteijn/saltgui-saltminion-debian
image: erwindon/saltgui-saltminion-debian:2018.3.3
hostname: saltminion-debian
depends_on:
- saltmaster-local
restart: on-failure
command: /usr/bin/salt-minion

saltminion-centos:
image: erwindon/saltgui-saltminion-centos:2018.3.3
hostname: saltminion-centos
depends_on:
- saltmaster-local
restart: on-failure
File renamed without changes.
File renamed without changes.
52 changes: 30 additions & 22 deletions docker/dockerfiles/dockerfile-saltmaster
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
FROM ubuntu:18.04
MAINTAINER Martijn Jacobs <martijn@devopsconsulting.nl>

ENV REFRESHED_ON "24 Jul 2018"
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="Erwin Dondorp <saltgui@dondorp.com>"
LABEL name=salt-master
LABEL project="SaltGUI testing"
LABEL version=2018.3.3

# add saltstack key and install dependencies
RUN apt-get update && apt-get install curl net-tools gnupg2 --yes
RUN curl --fail --silent --show-error --location https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
RUN echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list

# install salt-master and salt-api, dependencies
RUN apt-get update && apt-get install salt-master salt-api --yes

# add a user for the frontend salt:salt
RUN useradd -m -s/bin/bash -p $(openssl passwd -1 salt) salt
ENV SALT_VERSION=2018.3.3
ENV DEBIAN_FRONTEND=noninteractive

# copy the master configuration
ADD ./conf/master /etc/salt/master

# install supervisor
RUN apt-get install -y supervisor
ADD ./conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# add saltstack key and install dependencies
RUN apt-get update \
&& apt-get install curl net-tools gnupg2 --yes --no-install-recommends \
&& apt-key adv --fetch-keys http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \
&& echo "deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION} bionic main" > /etc/apt/sources.list.d/saltstack.list \
# install salt-master and salt-api, dependencies
&& apt-get update \
&& apt-get install salt-master=${SALT_VERSION}* salt-api=${SALT_VERSION}* python3-cherrypy3 --yes --no-install-recommends \
# add a user for the frontend salt:salt
&& useradd -m -s/bin/bash -p $(openssl passwd -1 salt) salt \
# install supervisor
&& apt-get install supervisor --yes --no-install-recommends \
# show which versions are installed
&& dpkg -l | grep salt- \
# cleanup temporary files
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove \
&& apt-get clean

# copy supervisord configuration
COPY ./conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# some volume configuration for the saltmaster
VOLUME ["/pki","/var/cache/salt","/var/log/salt"]
VOLUME ["/pki", "/var/cache/salt", "/var/log/salt"]
EXPOSE 3333 4505 4506

# show which versions are installed
RUN dpkg -l | grep salt\-
# define main container command
CMD /usr/bin/supervisord
28 changes: 28 additions & 0 deletions docker/dockerfiles/dockerfile-saltminion-centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM centos:7.6.1810

LABEL maintainer="Erwin Dondorp <saltgui@dondorp.com>"
LABEL name=salt-minion
LABEL project="SaltGUI testing"
LABEL version=2018.3.3

ENV SALT_VERSION=2018.3.3
ENV DEBIAN_FRONTEND=noninteractive

# add saltstack key and install dependencies
RUN yum install epel-release curl gnupg2 net-tools --assumeyes \
&& rpm --import https://repo.saltstack.com/py3/redhat/7/x86_64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \
&& echo -e "[salt-py3-latest]\nname=SaltStack Latest Release Channel Python 3 for RHEL/Centos \$releasever\nbaseurl=https://repo.saltstack.com/py3/redhat/7/\$basearch/archive/${SALT_VERSION}\nenabled=1\ngpgcheck=1\ngpgkey=https://repo.saltstack.com/py3/redhat/7/\$basearch/latest/SALTSTACK-GPG-KEY.pub\n" > /etc/yum.repos.d/salt-py3-latest.repo \
# install salt-minion
&& yum update --assumeyes \
&& yum install salt-minion-${SALT_VERSION}* --assumeyes \
# show which versions are installed
&& rpm -qa | grep salt- \
# cleanup temporary files
&& rm -rf /var/lib/yum/* /var/cache/yum \
&& yum clean all

# copy the minion configuration
COPY ./conf/minion /etc/salt/minion

# define main container command
CMD /usr/bin/salt-minion
35 changes: 23 additions & 12 deletions docker/dockerfiles/dockerfile-saltminion-debian
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
FROM debian:9
MAINTAINER Martijn Jacobs <martijn@devopsconsulting.nl>

ENV REFRESHED_ON "24 Jul 2018"
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="Erwin Dondorp <saltgui@dondorp.com>"
LABEL name=salt-minion
LABEL project="SaltGUI testing"
LABEL version=2018.3.3

# add saltstack key and install dependencies
RUN apt-get update && apt-get install curl gnupg net-tools --yes
RUN curl --fail --silent --show-error --location https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
RUN echo 'deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main' > /etc/apt/sources.list.d/saltstack.list
ENV SALT_VERSION=2018.3.3
ENV DEBIAN_FRONTEND=noninteractive

# install salt-minion
RUN apt-get update && apt-get install salt-minion --yes
# add saltstack key and install dependencies
RUN apt-get update \
&& apt-get install curl dirmngr gnupg net-tools --yes --no-install-recommends \
&& apt-key adv --fetch-keys http://repo.saltstack.com/py3/debian/9/amd64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \
&& echo "deb http://repo.saltstack.com/py3/debian/9/amd64/archive/${SALT_VERSION} stretch main" > /etc/apt/sources.list.d/saltstack.list \
# install salt-minion
&& apt-get update \
&& apt-get install salt-minion=${SALT_VERSION}* --yes --no-install-recommends \
# show which versions are installed
&& dpkg -l | grep salt- \
# cleanup temporary files
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove \
&& apt-get clean

# copy the minion configuration
ADD ./conf/minion /etc/salt/minion
COPY ./conf/minion /etc/salt/minion

# show which versions are installed
RUN dpkg -l | grep salt\-
# define main container command
CMD /usr/bin/salt-minion
35 changes: 23 additions & 12 deletions docker/dockerfiles/dockerfile-saltminion-ubuntu
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
FROM ubuntu:18.04
MAINTAINER Martijn Jacobs <martijn@devopsconsulting.nl>

ENV REFRESHED_ON "24 Jul 2018"
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="Erwin Dondorp <saltgui@dondorp.com>"
LABEL name=salt-minion
LABEL project="SaltGUI testing"
LABEL version=2018.3.3

# add saltstack key and install dependencies
RUN apt-get update && apt-get install curl gnupg2 net-tools --yes
RUN curl --fail --silent --show-error --location https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
RUN echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list
ENV SALT_VERSION=2018.3.3
ENV DEBIAN_FRONTEND=noninteractive

# install salt-minion
RUN apt-get update && apt-get install salt-minion --yes
# add saltstack key and install dependencies
RUN apt-get update \
&& apt-get install curl gnupg2 net-tools --yes --no-install-recommends \
&& apt-key adv --fetch-keys http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub \
&& echo "deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > /etc/apt/sources.list.d/saltstack.list \
# install salt-minion
&& apt-get update \
&& apt-get install salt-minion=${SALT_VERSION}* --yes --no-install-recommends \
# show which versions are installed
&& dpkg -l | grep salt- \
# cleanup temporary files
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove \
&& apt-get clean

# copy the minion configuration
ADD ./conf/minion /etc/salt/minion
COPY ./conf/minion /etc/salt/minion

# show which versions are installed
RUN dpkg -l | grep salt\-
# define main container command
CMD /usr/bin/salt-minion
2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yarn jslint
# and if our css is sane
yarn stylelint

# start a salt master, two salt minions and saltgui to run tests on
# start a salt master, three salt minions and saltgui to run tests on
docker-compose -f docker/docker-compose.yml up -d

# wait until all are up
Expand Down