


If SITE_NAME has not been set, or is still set to nginx.local, then the reconfig playbook will simply generate a self signed certificate for the nginx.local domain and restart the nginx process, skipping all other major steps in the playbook.This playbook will perform the following tasks: In order to either create a self signed certificate for nginx.local or reconfigure the server to use a different domain besides nginx.local, then use the following to execute this playbook.Ĭd /etc/ansible/roles/clusterfrak.nginx/filesįor this example we will assume we have already ran the following "export SITE_NAME=" on your nginx host

#Ansible install mongodb centos download
Running ansible-galaxy install command will simply go to the galaxy and download the newest version of the role. Running the ansible-galaxy install clusterfrak.nginx action will automatically download the role into /etc/ansible/roles/clusterfrak.nginxĢ. Now that we have the server set up to run ansible playbooks and roles, we need to download the newest version of the role from the ansible galaxy. To set a variable value simply export the variable prior to running the role install playbook.ġ. SSL_DIR - Location that nginx will store any generated certificates.SITE_NAME - Site that nginx will set up a default server instance for.STATUS_PORT - Port nginx will use to serve web server stats.HTTPS_PORT - Port nginx will listen on for https connections.HTTP_PORT - Port nginx will listen on for http connections.

In order to customize the installation of Nginx, simply export the ansible corresponding shell variable to set the value to something other than default prior to installing the role. If no shell environment variable is available or set, then ansible will configure itself to use the default values. Ansible will attempt to gather shell environment variable values and use those values to over-ride the default values that are set. The role is set with default values for each of the available variables. The clusterfrak.nginx role uses a few environment variables to automatically configure Nginx. Set Ansible localhost entry so that ansible knows it will run against localhost and can talk to itself on localhost without attempting to open a TCP socket connection.Įcho localhost ansible_connection=local > /etc/ansible/hosts In this tutorial we are going to set up ansible roles in /etc/ansible/roles Sudo apt-get install -y curl vim python python-dev python-openssl libffi-dev libssl-dev gccĬreate the directory structure that you are going to use.
#Ansible install mongodb centos update
RedHat based distros (RHEL, CentOS, AL): sudo yum -y install epel-releaseĭebian based distros (Debian, Ubuntu): sudo apt-get update
