This repos aims to give a simple example of how to automate a server provisioning and node app deployment using Ansible
- Build you server, run:
docker-compose up -d
- Try to connect to the server with ssh:
ssh root@localhost
root password: root
-
In 'DevOps/devops/create-user/public-keys' create a new file 'firstName.lastName.pub'
-
Add your public key:
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
copy and past the result to your file 'firstName.lastName.pub'.
- To create the user 'superUser', run command:
yarn create:user
Vault password 'hello'
- Start provisioning your server:
yarn provision
- To deploy your application:
yarn deploy
- To connect to your server:
ssh superUser@localhost
Now you are connected to the server. You can check if you application is deployed.
- To encrypt you password using Ansible vault, run:
ansible-vault encrypt_string '***Password***'
in our case we encrypt the superUser password, you can find the result in 'DevOps/devops/create-user/vars/main.yml' the vault password used is 'hello'