Docker – Quick Reference

A quick reference guide to common Docker commands. # to pull a container image docker pull nginx # to make container – persistant container that mounts conf and webroot docker run –name repo-nginx -p 80:80 –restart unless-stopped -v /data/scratch/repo-nginx:/usr/share/nginx/html -v /data/docker/repo-nginx/default.conf:/etc/nginx # Remove all stopped containers docker system prune -f #to all list containers docker […]

Ansible – Creating playbook that sets user password to vault stored variable

This will use ansible vault that allows the storage of sensitive information in an encrypted state within playbooks. Step 1 – create password that is stored in ansible vault mkdir -p ~/ansible/vault touch ~/ansible/vault/N0s3kr1t cd ~/ansible/vault ## encrypt secret file and prompts for a password ansible-vault encrypt N0s3kr1t ## run the following after installing passlib […]

Vagrant setup – centos7 / docker

# install docker yum install -y yum-utils yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install docker-ce # configure docker systemctl enable docker systemctl start docker # configuring current user in docker group sudo usermod -aG docker $(whoami) # install vagrant yum install -y https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.rpm

Vagrant – VagrantFile

VagrantFile is in ruby syntax. This is configuration that is used when vagrant creates vms. If no directory is given vagrant will mount vagrant folder as shared folder between host and container/vm . To setup custom sync folder Vagrant.configure(“2”) do |config| config.vm.box = ‘centos/7’ # configures synced folder config.vm.synced_folder “./content”, “/vagrant” end To setup multi […]

Vagrant boxes

Vagrant boxes are preconfigured images that can be downloaded from vagrant to create your own homogeneous test environment across multisystems and platforms. using vagrantup to get boxes you can download vagrant boxes (image) from vagrantup.com or create your own use version control if developing your own #vagrant box commands vagrant box add <URL> vagrant box […]

RHCA – Ansible Automation – Exam 407 – Use Ansible Vault in playbooks to protect sensitive data

Ansible vault allows for sensitive information to be stored encrypted within playbooks. This section I recommend making some playbooks that uses vault. Such as make user and assign password. Store ssh key as ansible vault. ansible vault – using external file: # to encrypt file ansible-vault encrypt <file> # to edit file – this will […]

RHCE – Network service – HTTP/HTTPS

Install the packages needed to provide the service # installs apache webserver yum install httpd Configure SELinux to support the service ## Common file context types ## # static website folders httpd_sys_content_t # dynamic website folders – where writes need to occur via apache user httpd_sys_rw_content_t # cgi folder httpd_sys_script_exec_t # httpd config httpd_config_t # […]