Skip to content

micnguyen266/Django-terraform-ansible-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-ansible-demo (Work-in-progress)

Check out site below. Still WIP!

demo.mrmikenguyen.com/static/hello.html

TODO: Need to finish setting up Django.

Steps that were done. Will cleanup and update later!

  1. Manually spin up Ubuntu server in Linode. (Plan on using Terraform to deploy infra)
  2. SSH to server.
  3. Create user under sudo group 4. useradd -m -s /bin/bash -G sudo mike
  4. Change user password 6. passwd mike
  5. Check if user was created 8. cat /etc/passwd
  6. Switch to mike user 10. su mike
  7. Change hostname through systemd 12. sudo hostnamectl set-hostname mike-systems
  8. Reload shell 14. bash
  9. In server for extra security and to auth by ssh without password auth "sudo vim /etc/ssh/sshd_config" change PermitRootLogin to "no", PubKeyAuthentication to "yes" and PasswordAuthentication to "no".
  10. Copy Public IP address of server and create A record in Linode domains.
  11. Install NGINX 18. sudo apt-get install nginx
  12. (To Update Later). Domain purchased on cloudflare. Created A record with public IP of Linode host. Turned off proxy on CF.
  13. Install Ansible on local machine. Created Ansible directory with 3 files hosts, deploy-demo.yml, and deploy.
  14. To test: ansible-playbook deploy-demo.yml -i hosts -K