├── 02-Terraform ├── 19-Cleanup │ ├── compute.tf │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 25-Local_Provisioners │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 27-Remote_Provisioners │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 28-Outputs │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 12-Count │ ├── prod.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 20-AMI │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── compute.tf │ └── variables.tf ├── 26-Destroy_Time_Provisioners │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 04-VPC_Vaiables │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 10-Data_Sources │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ └── providers.tf ├── 11-Public_Subnets │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ └── providers.tf ├── 23-EC2_SSH │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 05-IGW_Referencing │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 06-Random_Resource │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 07-Lifecycle_Policies │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 08-Public_Route_Table │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 09-Default_Route_Table │ ├── prod.tfvars │ ├── variables.tf │ ├── backends.tf │ └── providers.tf ├── 13-Private_Subnet_TAY │ ├── prod.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 15-Local_Values │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 16-cidrsubnet │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 21-EC2_Initial │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── variables.tf │ └── compute.tf ├── 22-EC2_Count_TAY │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── variables.tf │ └── compute.tf ├── 18-Security_Groups │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 17-Route_Table_Associations │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 24-EC2_Userdata_Template │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 14-Variables_and_the_Console │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ └── variables.tf ├── 03-Terraform_Cloud_Setup │ ├── backends.tf │ ├── providers.tf │ └── main.tf ├── 01-AWS_Provider │ └── providers.tf └── 02-Terraform_Apply │ ├── providers.tf │ └── main.tf ├── 03-Ansible ├── 04-apt_module │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ └── grafana-playbook.yml │ └── variables.tf ├── 02-Apt_key_Module │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── playbooks │ │ └── grafana-playbook.yml │ ├── main-userdata.tpl │ └── variables.tf ├── 01-Playbook_Scaffolding │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── playbooks │ │ └── grafana-playbook.yml │ ├── main-userdata.tpl │ └── variables.tf ├── 05-Systemd_module_TAY │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── variables.tf │ └── playbooks │ │ └── grafana-playbook.yml ├── 06-Playbook_Destroy │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ ├── grafana-destroy.yml │ │ └── grafana-playbook.yml │ └── variables.tf ├── 03-apt_repository_module │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ └── grafana-playbook.yml │ └── variables.tf ├── 07-Calling_Ansible_from_Terraform │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── playbooks │ │ ├── grafana-destroy.yml │ │ └── grafana-playbook.yml ├── 08-Waiting_for_EC2 │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ ├── grafana-destroy.yml │ │ └── grafana-playbook.yml │ └── variables.tf ├── 09-Prom_Playbook_Scaffolding │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── playbooks │ │ └── grafana-destroy.yml ├── 15-Service_Template_and_Systemd │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ └── prometheus.service.j2 │ └── main-userdata.tpl ├── 13-Copying_Files │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ └── grafana-destroy.yml │ └── variables.tf ├── 11-Users_and_Groups │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ ├── playbooks │ │ └── grafana-destroy.yml │ └── variables.tf ├── 10-get_url_and_unarchive │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── playbooks │ │ └── grafana-destroy.yml ├── 12-Loops_Directories_Files │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── main-userdata.tpl │ └── playbooks │ │ └── grafana-destroy.yml └── 14-Jinja_Templates_and_Variables │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── playbooks │ ├── prometheus.yml.j2 │ └── grafana-destroy.yml │ └── main-userdata.tpl ├── 04-Jenkins ├── 08-EC2_Wait │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 04-Jenkins_Apply │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 01-Install_Jenkins │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── prometheus.service.j2 │ │ └── jenkins.yml │ ├── main-userdata.tpl │ └── variables.tf ├── 02-Commit_your_Code │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── providers.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── main-userdata.tpl │ └── variables.tf ├── 10-Jenkinsfile_Input │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 12-Configure_tfvars │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 16-Abort_Post_Action │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 03-Terraform_Credentials │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 05-Our_First_Jenkinsfile │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── Jenkinsfile │ └── main-userdata.tpl ├── 06-Jenkinsfile_Environment │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── Jenkinsfile │ └── main-userdata.tpl ├── 09-Jenkinsfile_Ansible │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ ├── main-userdata.tpl │ └── variables.tf ├── 11-Jenkinsfile_Input_TAY │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 13-Configure_Dev_Branch │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 20-Testing_Apps_Ansible │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── node-test.yml │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 12-Jenkinsfile_Post_Section │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 14-Configure_Multiple_Branches │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 15-Jenkinsfile_Conditionals │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 17-Adding_JQ_to_Jenkinsfile │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 18-Custom_Outputs_Inventory │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 19-Custom_Outputs_EC2_Wait_TAY │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── jenkins.yml │ │ └── prometheus.service.j2 │ ├── providers.tf │ └── main-userdata.tpl ├── 21-Optimizing_Test_Playbook │ ├── aws_hosts │ ├── dev.tfvars │ ├── main.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ │ ├── prometheus.yml.j2 │ │ ├── grafana-destroy.yml │ │ ├── node-test.yml │ │ ├── prometheus.service.j2 │ │ ├── jenkins.yml │ │ └── grafana.yml │ ├── providers.tf │ └── main-userdata.tpl └── 07-Jenkinsfile_Apply_and_Destroy │ ├── aws_hosts │ ├── terraform.tfvars │ ├── backends.tf │ ├── .gitignore │ ├── playbooks │ ├── prometheus.yml.j2 │ ├── grafana-destroy.yml │ ├── jenkins.yml │ └── prometheus.service.j2 │ ├── providers.tf │ ├── main-userdata.tpl │ └── Jenkinsfile └── .gitignore /02-Terraform/19-Cleanup/compute.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] 2 | 3 | 4 | -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /02-Terraform/12-Count/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/20-AMI/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/aws_hosts: -------------------------------------------------------------------------------- 1 | [servers] -------------------------------------------------------------------------------- /02-Terraform/04-VPC_Vaiables/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/10-Data_Sources/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/11-Public_Subnets/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/19-Cleanup/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/23-EC2_SSH/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/05-IGW_Referencing/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/06-Random_Resource/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/07-Lifecycle_Policies/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/08-Public_Route_Table/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/09-Default_Route_Table/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/13-Private_Subnet_TAY/prod.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/15-Local_Values/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/16-cidrsubnet/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/21-EC2_Initial/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/22-EC2_Count_TAY/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-Terraform/18-Security_Groups/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-Terraform/17-Route_Table_Associations/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/24-EC2_Userdata_Template/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-Terraform/14-Variables_and_the_Console/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.177.4.117 9 | 3.101.190.169 -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.177.4.117 9 | 3.101.190.169 -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.177.4.117 9 | 3.101.190.169 -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.177.4.117 9 | 3.101.190.169 -------------------------------------------------------------------------------- /02-Terraform/04-VPC_Vaiables/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/10-Data_Sources/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/05-IGW_Referencing/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/06-Random_Resource/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/aws_hosts: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | 4 | 5 | 6 | 7 | 8 | 54.177.4.117 9 | 3.101.190.169 -------------------------------------------------------------------------------- /02-Terraform/07-Lifecycle_Policies/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/08-Public_Route_Table/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/09-Default_Route_Table/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.124.0.0/16" 4 | } -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/dev.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/main.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.124.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vpc_cidr = "10.123.0.0/16" 2 | key_name = "mtc_key" 3 | public_key_path = "/home/ubuntu/.ssh/mtckey.pub" -------------------------------------------------------------------------------- /02-Terraform/12-Count/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/20-AMI/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/11-Public_Subnets/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | default = "10.123.1.0/24" 8 | } -------------------------------------------------------------------------------- /02-Terraform/16-cidrsubnet/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/19-Cleanup/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/23-EC2_SSH/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/04-VPC_Vaiables/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/05-IGW_Referencing/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/06-Random_Resource/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/10-Data_Sources/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/11-Public_Subnets/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/15-Local_Values/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/18-Security_Groups/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/21-EC2_Initial/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/22-EC2_Count_TAY/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/07-Lifecycle_Policies/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/08-Public_Route_Table/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/09-Default_Route_Table/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/13-Private_Subnet_TAY/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/03-Terraform_Cloud_Setup/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/14-Variables_and_the_Console/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/17-Route_Table_Associations/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/24-EC2_Userdata_Template/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/backends.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "remote" { 3 | organization = "org-name-here" 4 | 5 | workspaces { 6 | name = "mtc-terransible" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /02-Terraform/12-Count/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/20-AMI/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /02-Terraform/16-cidrsubnet/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/19-Cleanup/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/21-EC2_Initial/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/23-EC2_SSH/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /02-Terraform/01-AWS_Provider/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/02-Terraform_Apply/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/04-VPC_Vaiables/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/05-IGW_Referencing/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/06-Random_Resource/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/10-Data_Sources/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/11-Public_Subnets/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/15-Local_Values/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/18-Security_Groups/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/22-EC2_Count_TAY/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /02-Terraform/03-Terraform_Cloud_Setup/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/07-Lifecycle_Policies/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/08-Public_Route_Table/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/09-Default_Route_Table/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/12-Count/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } -------------------------------------------------------------------------------- /02-Terraform/13-Private_Subnet_TAY/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/24-EC2_Userdata_Template/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/backends.tf: -------------------------------------------------------------------------------- 1 | # terraform { 2 | # backend "remote" { 3 | # organization = "org-name-here" 4 | 5 | # workspaces { 6 | # name = "mtc-terransible" 7 | # } 8 | # } 9 | # } -------------------------------------------------------------------------------- /02-Terraform/04-VPC_Vaiables/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_vpc" "mtc_vpc" { 2 | cidr_block = var.vpc_cidr 3 | enable_dns_hostnames = true 4 | enable_dns_support = true 5 | 6 | tags = { 7 | Name = "mtc_vpc" 8 | } 9 | } -------------------------------------------------------------------------------- /02-Terraform/14-Variables_and_the_Console/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/17-Route_Table_Associations/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/02-Terraform_Apply/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_vpc" "mtc_vpc" { 2 | cidr_block = "10.123.0.0/16" 3 | enable_dns_hostnames = true 4 | enable_dns_support = true 5 | 6 | tags = { 7 | Name = "mtc_vpc" 8 | } 9 | } -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | } -------------------------------------------------------------------------------- /02-Terraform/03-Terraform_Cloud_Setup/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_vpc" "mtc_vpc" { 2 | cidr_block = "10.123.0.0/16" 3 | enable_dns_hostnames = true 4 | enable_dns_support = true 5 | 6 | tags = { 7 | Name = "mtc_vpc" 8 | } 9 | } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /02-Terraform/20-AMI/compute.tf: -------------------------------------------------------------------------------- 1 | data "aws_ami" "server_ami" { 2 | most_recent = true 3 | 4 | owners = ["099720109477"] 5 | 6 | filter { 7 | name = "name" 8 | values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] 9 | } 10 | } -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | *.pem 3 | 4 | # Local .terraform directories 5 | **/.terraform/* 6 | 7 | # .tfstate files 8 | **/*.tfstate 9 | **/*.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Ansible 15 | *.retry 16 | 17 | *PX* 18 | ''$'\001''PX@'$'\240\003\002''@8' -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/playbooks/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | scrape_configs: 4 | - job_name: 'node' 5 | static_configs: 6 | - targets: ['{{ listen_address }}:{{ listen_port }}'] -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | } 6 | } 7 | } 8 | 9 | provider "aws" { 10 | region = "us-west-1" 11 | shared_credentials_file="/home/ubuntu/.aws/credentials" 12 | } -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | - name: Add Grafana repo to sources.list 9 | - name: Update apt cache and install grafana 10 | - name: Make sure grafana is started -------------------------------------------------------------------------------- /02-Terraform/20-AMI/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/16-cidrsubnet/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/19-Cleanup/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/15-Local_Values/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/18-Security_Groups/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/13-Private_Subnet_TAY/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/14-Variables_and_the_Console/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/17-Route_Table_Associations/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } -------------------------------------------------------------------------------- /02-Terraform/05-IGW_Referencing/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_vpc" "mtc_vpc" { 2 | cidr_block = var.vpc_cidr 3 | enable_dns_hostnames = true 4 | enable_dns_support = true 5 | 6 | tags = { 7 | Name = "mtc_vpc" 8 | } 9 | } 10 | 11 | resource "aws_internet_gateway" "mtc_internet_gateway" { 12 | vpc_id = aws_vpc.mtc_vpc.id 13 | 14 | tags = { 15 | Name = "mtc_igw" 16 | } 17 | } -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | # - name: Add Grafana repo to sources.list 12 | # - name: Update apt cache and install grafana 13 | # - name: Make sure grafana is started -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/playbooks/node-test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Test for Grafana and Prometheus Access 3 | hosts: main 4 | gather_facts: no 5 | tasks: 6 | - name: grafana 7 | uri: 8 | url: http://{{inventory_hostname}}:3000 9 | follow_redirects: none 10 | status_code: [302] 11 | - name: prom 12 | uri: 13 | url: http://{{inventory_hostname}}:9090 14 | follow_redirects: none 15 | status_code: [302] -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | environment { 4 | TF_IN_AUTOMATION = 'true' 5 | } 6 | stages { 7 | stage('Init') { 8 | steps { 9 | sh 'ls' 10 | sh 'terraform init' 11 | } 12 | } 13 | stage('Plan') { 14 | steps { 15 | sh 'terraform plan' 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /02-Terraform/06-Random_Resource/main.tf: -------------------------------------------------------------------------------- 1 | resource "random_id" "random" { 2 | byte_length = 2 3 | } 4 | 5 | resource "aws_vpc" "mtc_vpc" { 6 | cidr_block = var.vpc_cidr 7 | enable_dns_hostnames = true 8 | enable_dns_support = true 9 | 10 | tags = { 11 | Name = "mtc_vpc-${random_integer.random.id}" 12 | } 13 | } 14 | 15 | resource "aws_internet_gateway" "mtc_internet_gateway" { 16 | vpc_id = aws_vpc.mtc_vpc.id 17 | 18 | tags = { 19 | Name = "mtc_igw" 20 | } 21 | } -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | stages { 4 | stage('Init') { 5 | steps { 6 | sh 'ls' 7 | sh 'export TF_IN_AUTOMATION=true' 8 | sh 'terraform init -no-color' 9 | } 10 | } 11 | stage('Plan') { 12 | steps { 13 | sh 'export TF_IN_AUTOMATION=true' 14 | sh 'terraform plan -no-color' 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get -y update && 7 | sudo apt-get -y install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get -y update && 7 | sudo apt-get -y install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get -y update && 7 | sudo apt-get -y install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/24-EC2_Userdata_Template/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get -y update && 7 | sudo apt-get -y install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get -y update && 7 | sudo apt-get -y install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/main-userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo hostnamectl set-hostname ${new_hostname} && 3 | sudo apt-get install -y apt-transport-https software-properties-common wget && 4 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - && 5 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && 6 | sudo apt-get update && 7 | sudo apt-get install grafana && 8 | sudo systemctl start grafana-server && 9 | sudo systemctl enable grafana-server.service -------------------------------------------------------------------------------- /02-Terraform/21-EC2_Initial/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } -------------------------------------------------------------------------------- /02-Terraform/07-Lifecycle_Policies/main.tf: -------------------------------------------------------------------------------- 1 | resource "random_id" "random" { 2 | byte_length = 2 3 | } 4 | 5 | resource "aws_vpc" "mtc_vpc" { 6 | cidr_block = var.vpc_cidr 7 | enable_dns_hostnames = true 8 | enable_dns_support = true 9 | 10 | tags = { 11 | Name = "mtc_vpc-${random_integer.random.id}" 12 | } 13 | lifecycle { 14 | create_before_destroy = true 15 | } 16 | } 17 | 18 | resource "aws_internet_gateway" "mtc_internet_gateway" { 19 | vpc_id = aws_vpc.mtc_vpc.id 20 | 21 | tags = { 22 | Name = "mtc_igw" 23 | } 24 | } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/09-Prom_Playbook_Scaffolding/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/10-get_url_and_unarchive/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/12-Loops_Directories_Files/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | # - name: Update apt cache and install grafana 17 | # - name: Make sure grafana is started -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/14-Jinja_Templates_and_Variables/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/grafana-destroy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: Delete Apt Key 8 | ansible.builtin.apt_key: 9 | id: 4E40DDF6D76E284A4A6780E48C8C34C524098CB6 10 | state: absent 11 | - name: Remove grafana.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: absent 16 | - name: Remove Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | state: absent -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/node-test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Test for Grafana and Prometheus access 3 | hosts: main 4 | gather_facts: no 5 | vars: 6 | apps: 7 | prometheus: 8 | port: 9090 9 | status_code: [302] 10 | grafana: 11 | port: 3000 12 | status_code: [302] 13 | tasks: 14 | - name: test_app 15 | ansible.builtin.uri: 16 | url: "http://{{ inventory_hostname }}:{{ item.value.port }}" 17 | follow_redirects: none 18 | status_code: "{{ item.value.status_code }}" 19 | loop: "{{ lookup('dict', apps) }}" 20 | -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 10 | state: present 11 | - name: Add Jenkins repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 14 | state: present 15 | filename: jenkins 16 | - name: Update apt cache and install jenkins 17 | apt: 18 | name: jenkins 19 | update_cache: yes -------------------------------------------------------------------------------- /02-Terraform/22-EC2_Count_TAY/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | - name: Update apt cache and install Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | update_cache: yes 20 | # - name: Make sure grafana is started -------------------------------------------------------------------------------- /02-Terraform/23-EC2_SSH/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/04-apt_module/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/02-Apt_key_Module/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /02-Terraform/25-Local_Provisioners/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/01-Playbook_Scaffolding/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/03-apt_repository_module/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /02-Terraform/24-EC2_Userdata_Template/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /02-Terraform/26-Destroy_Time_Provisioners/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/12-Configure_tfvars/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/16-Abort_Post_Action/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /02-Terraform/21-EC2_Initial/compute.tf: -------------------------------------------------------------------------------- 1 | data "aws_ami" "server_ami" { 2 | most_recent = true 3 | 4 | owners = ["099720109477"] 5 | 6 | filter { 7 | name = "name" 8 | values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] 9 | } 10 | } 11 | 12 | resource "aws_instance" "mtc_main" { 13 | instance_type = var.main_instance_type 14 | ami = data.aws_ami.server_ami.id 15 | 16 | tags = { 17 | Name = "mtc_main" 18 | } 19 | 20 | # key_name = "" 21 | vpc_security_group_ids = [aws_security_group.mtc_sg.id] 22 | subnet_id = aws_subnet.mtc_public_subnet[count.index].id 23 | 24 | root_block_device { 25 | volume_size = var.main_vol_size 26 | } 27 | } -------------------------------------------------------------------------------- /04-Jenkins/03-Terraform_Credentials/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/05-Our_First_Jenkinsfile/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/06-Jenkinsfile_Environment/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/11-Jenkinsfile_Input_TAY/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/12-Jenkinsfile_Post_Section/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/13-Configure_Dev_Branch/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/15-Jenkinsfile_Conditionals/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/17-Adding_JQ_to_Jenkinsfile/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/18-Custom_Outputs_Inventory/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/20-Testing_Apps_Ansible/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /03-Ansible/15-Service_Template_and_Systemd/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/14-Configure_Multiple_Branches/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/19-Custom_Outputs_EC2_Wait_TAY/playbooks/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus systemd service unit 3 | Wants=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | User=prometheus 9 | Group=prometheus 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | ExecStart=/usr/local/bin/prometheus \ 12 | --config.file=/etc/prometheus/prometheus.yml \ 13 | --storage.tsdb.path=/var/lib/prometheus \ 14 | --web.console.templates=/etc/prometheus/consoles \ 15 | --web.console.libraries=/etc/prometheus/console_libraries \ 16 | --web.listen-address={{ listen_address }}:{{ listen_port }} 17 | 18 | SyslogIdentifier=prometheus 19 | Restart=always 20 | 21 | [Install] 22 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: Install Java 8 | apt: 9 | name: openjdk-11-jdk 10 | state: present 11 | update_cache: yes 12 | - name: download apt key 13 | ansible.builtin.apt_key: 14 | url: https://pkg.jenkins.io/debian-stable/jenkins.io.key 15 | state: present 16 | - name: Add Jenkins repo to sources.list 17 | ansible.builtin.apt_repository: 18 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 19 | state: present 20 | filename: jenkins 21 | - name: Update apt cache and install jenkins 22 | apt: 23 | name: jenkins 24 | update_cache: yes -------------------------------------------------------------------------------- /02-Terraform/27-Remote_Provisioners/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "public_cidrs" { 7 | type = list(string) 8 | default = ["10.123.1.0/24", "10.123.3.0/24"] 9 | } 10 | 11 | variable "private_cidrs" { 12 | type = list(string) 13 | default = ["10.123.2.0/24", "10.123.4.0/24"] 14 | } 15 | 16 | variable "main_instance_type" { 17 | type = string 18 | default = "t2.micro" 19 | } 20 | 21 | variable "main_vol_size" { 22 | type = number 23 | default = 8 24 | } 25 | 26 | variable "main_instance_count" { 27 | type = number 28 | default = 1 29 | } 30 | 31 | variable "key_name" { 32 | type = string 33 | } 34 | 35 | variable "public_key_path" { 36 | type = string 37 | } -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: main 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | - name: Update apt cache and install Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | update_cache: yes 20 | - name: Ensure Grafana is started and enabled 21 | ansible.builtin.systemd: 22 | name: grafana-server 23 | enabled: yes 24 | state: started -------------------------------------------------------------------------------- /04-Jenkins/07-Jenkinsfile_Apply_and_Destroy/Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | environment { 4 | TF_IN_AUTOMATION = 'true' 5 | } 6 | stages { 7 | stage('Init') { 8 | steps { 9 | sh 'ls' 10 | sh 'terraform init -no-color' 11 | } 12 | } 13 | stage('Plan') { 14 | steps { 15 | sh 'terraform plan -no-color' 16 | } 17 | } 18 | stage('Apply') { 19 | steps { 20 | sh 'terraform apply -auto-approve -no-color' 21 | } 22 | } 23 | stage('Destroy') { 24 | steps { 25 | sh 'terraform destroy -auto-approve -no-color' 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /03-Ansible/05-Systemd_module_TAY/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | - name: Update apt cache and install Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | update_cache: yes 20 | - name: Ensure Grafana is started and enabled 21 | ansible.builtin.systemd: 22 | name: grafana-server 23 | enabled: yes 24 | state: started -------------------------------------------------------------------------------- /03-Ansible/06-Playbook_Destroy/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: hosts 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | - name: Update apt cache and install Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | update_cache: yes 20 | - name: Ensure Grafana is started and enabled 21 | ansible.builtin.systemd: 22 | name: grafana-server 23 | enabled: yes 24 | state: started -------------------------------------------------------------------------------- /03-Ansible/07-Calling_Ansible_from_Terraform/playbooks/grafana-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: main 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | filename: grafana 15 | state: present 16 | - name: Update apt cache and install Grafana 17 | ansible.builtin.apt: 18 | name: grafana 19 | update_cache: yes 20 | - name: Ensure Grafana is started and enabled 21 | ansible.builtin.systemd: 22 | name: grafana-server 23 | enabled: yes 24 | state: started -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/playbooks/jenkins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: Install Java 8 | apt: 9 | name: openjdk-17-jdk 10 | state: present 11 | update_cache: yes 12 | - name: download apt key 13 | ansible.builtin.apt_key: 14 | url: https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key 15 | state: present 16 | - name: Add Jenkins repo to sources.list 17 | ansible.builtin.apt_repository: 18 | repo: deb https://pkg.jenkins.io/debian-stable binary/ 19 | state: present 20 | filename: jenkins 21 | - name: Update apt cache and install jenkins 22 | apt: 23 | name: jenkins 24 | update_cache: yes 25 | - name: start Jenkins 26 | ansible.builtin.service: 27 | name: jenkins 28 | state: started 29 | enabled: yes -------------------------------------------------------------------------------- /04-Jenkins/21-Optimizing_Test_Playbook/playbooks/grafana.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Grafana 3 | hosts: localhost 4 | become: yes 5 | 6 | tasks: 7 | - name: download apt key 8 | ansible.builtin.apt_key: 9 | url: https://packages.grafana.com/gpg.key 10 | state: present 11 | - name: Add Grafana repo to sources.list 12 | ansible.builtin.apt_repository: 13 | repo: deb https://packages.grafana.com/oss/deb stable main 14 | state: present 15 | filename: grafana 16 | - name: Update apt cache and install grafana 17 | apt: 18 | name: grafana 19 | update_cache: yes 20 | # - name: Make sure grafana is started 21 | # ansible.builtin.service: 22 | # state: started 23 | # enabled: true 24 | # name: grafana-server 25 | # use: sysvinit 26 | - name: Start Jenkins using service command 27 | ansible.builtin.command: service grafana-server start -------------------------------------------------------------------------------- /02-Terraform/22-EC2_Count_TAY/compute.tf: -------------------------------------------------------------------------------- 1 | data "aws_ami" "server_ami" { 2 | most_recent = true 3 | 4 | owners = ["099720109477"] 5 | 6 | filter { 7 | name = "name" 8 | values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] 9 | } 10 | } 11 | 12 | resource "random_id" "mtc_node_id" { 13 | byte_length = 2 14 | count = var.main_instance_count 15 | } 16 | 17 | 18 | resource "aws_instance" "mtc_main" { 19 | count = var.main_instance_count 20 | instance_type = var.main_instance_type 21 | ami = data.aws_ami.server_ami.id 22 | 23 | tags = { 24 | Name = "mtc-main-${random_id.mtc_node_id[count.index].dec}" 25 | } 26 | 27 | # key_name = "" 28 | vpc_security_group_ids = [aws_security_group.mtc_sg.id] 29 | subnet_id = aws_subnet.mtc_public_subnet[count.index].id 30 | 31 | root_block_device { 32 | volume_size = var.main_vol_size 33 | } 34 | } -------------------------------------------------------------------------------- /02-Terraform/28-Outputs/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/08-EC2_Wait/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /03-Ansible/08-Waiting_for_EC2/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /03-Ansible/13-Copying_Files/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/01-Install_Jenkins/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/04-Jenkins_Apply/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /02-Terraform/08-Public_Route_Table/main.tf: -------------------------------------------------------------------------------- 1 | resource "random_id" "random" { 2 | byte_length = 2 3 | } 4 | 5 | resource "aws_vpc" "mtc_vpc" { 6 | cidr_block = var.vpc_cidr 7 | enable_dns_hostnames = true 8 | enable_dns_support = true 9 | 10 | tags = { 11 | Name = "mtc_vpc-${random_integer.random.id}" 12 | } 13 | lifecycle { 14 | create_before_destroy = true 15 | } 16 | } 17 | 18 | resource "aws_internet_gateway" "mtc_internet_gateway" { 19 | vpc_id = aws_vpc.mtc_vpc.id 20 | 21 | tags = { 22 | Name = "mtc_igw" 23 | } 24 | } 25 | 26 | resource "aws_route_table" "mtc_public_rt" { 27 | vpc_id = aws_vpc.mtc_vpc.id 28 | 29 | tags = { 30 | Name = "mtc-public" 31 | } 32 | } 33 | 34 | resource "aws_route" "default_route" { 35 | route_table_id = aws_route_table.mtc_public_rt.id 36 | destination_cidr_block = "0.0.0.0/0" 37 | gateway_id = aws_internet_gateway.mtc_internet_gateway.id 38 | } 39 | -------------------------------------------------------------------------------- /03-Ansible/11-Users_and_Groups/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/02-Commit_your_Code/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/09-Jenkinsfile_Ansible/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } -------------------------------------------------------------------------------- /04-Jenkins/10-Jenkinsfile_Input/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_cidr" { 2 | type = string 3 | default = "10.123.0.0/16" 4 | } 5 | 6 | variable "access_ip" { 7 | type = string 8 | default = "0.0.0.0/0" 9 | } 10 | 11 | variable "cloud9_ip" { 12 | type = string 13 | default = "54.83.113.76/32" 14 | } 15 | 16 | variable "public_cidrs" { 17 | type = list(string) 18 | default = ["10.123.1.0/24", "10.123.3.0/24"] 19 | } 20 | 21 | variable "private_cidrs" { 22 | type = list(string) 23 | default = ["10.123.2.0/24", "10.123.4.0/24"] 24 | } 25 | 26 | variable "main_instance_type" { 27 | type = string 28 | default = "t2.micro" 29 | } 30 | 31 | variable "main_vol_size" { 32 | type = number 33 | default = 8 34 | } 35 | 36 | variable "main_instance_count" { 37 | type = number 38 | default = 2 39 | } 40 | 41 | variable "key_name" { 42 | type = string 43 | } 44 | 45 | variable "public_key_path" { 46 | type = string 47 | } --------------------------------------------------------------------------------