Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 1.96 KB

README.md

File metadata and controls

81 lines (53 loc) · 1.96 KB

basic-networking-submission

Proyek Membangun Web Server (Apache2, Nginx & Node.js) adalah submission akhir untuk kelas Belajar Jaringan Komputer untuk Pemula - Dicoding.

Otomatisasi deployment dan konfigurasi menggunakan tools IaC (Infrastucture as Code):

Requirements

Installasi

  1. Clone repository

    git clone https://github.com/andrijunaedi/basic-networking-submission.git
    cd basic-networking-submission
  2. Copy terraform.trfvars-example ke terraform.tfvars dan sesuaikan valuenya.

    cp terraform.trfvars-example terraform.tfvars
    nano terraform.tfvars

    Note:

    • profile: profile AWS Credentials
    • public_key: path public key SSH
    • private_key: path private key SSH
  3. Init Terraform

    terraform init
  4. Terraform plan

    terraform plan
  5. Apply terraform

    terraform apply
    
    # Terraform apply auto approve
    terraform apply -auto-approve

Destroy semua infrastructure

terraform destroy

# Terraform destroy auto approve
terraform destroy -auto-approve

Modules

Troubleshoot

Re-run ansible playbook secara manual

ansible_command berikut ada pada outputs terraform:

 ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu -i '$PUBLIC_IP,' --private-key $PRIVATE_KEY -e 'pub_key=$PUBLIC_KEY' playbooks/setup-webserver.yml