$ ansible -versionĬonfigured module search path = Īnsible python module location = /usr/lib/python3/dist-packages/ansibleĪnsible collection location = /home/ubuntu/.ansible/collections:/usr/share/ansible/collections Sudo apt-key adv -keyserver -recv-keys 93C4A3FD7BB9C367Ĭonfirm Ansible version installed. If you get error like “ apt-add-repository: command not found“, then check install add-apt-repository on Debian/Ubuntu.įor Debian echo "deb trusty main" | sudo tee /etc/apt//ansible.list Git version 2.25.1 Step 2: Install Ansible on Ubuntu / DebianĪdd Ansible PPA repository and install Ansible.įor Ubuntu sudo apt-add-repository ppa:ansible/ansible Sudo apt install git curl wget software-properties-commonĬonfirm that Git version installed is = 2.x. Start work from an updated system with git installed. Here are the steps you need to follow to have Semaphore installed on Ubuntu / Debian system. We will use managed services like AWS Relational Database Service (RDS) and AWS Elastic Container Service (ECS).For CentOS 7, use: Install Semaphore Ansible Web UI on CentOS 7 / CentOS 8 How to Install Semaphore on Ubuntu / Debian In the next article of this series, we will see how to deploy the WordPress image in AWS. Now all is in place to keep working on AWS. We have checked the generated image was working with docker-compose. The two methods have their own Packer manifest. Here we have worked with a local Docker registry and a remote one in AWS ECR deployed with Terraform. We have seen how to reuse an existing Ansible role to create Docker images with Packer. You have to create your own S3 bucket and replace the value in terraform/environments/dev/aws-ecr/main.tf: terraform packer build packer/wordpress.json Build and push the Docker image to the AWS ECR The docker image in AWS ECR Conclusion ![]() $ mkdir -p terraform/environments/dev/aws-ecr Creation of the aws-ecr layer for development environment Install docker-compose: $ pip install -user docker-compose Installation of Docker-Compose using pipįor Docker, I use Docker for Desktop Deploy AWS Elastic Container Registry (ECR)Īt the project root, create the terraform structure and the aws-ecr module: $ mkdir -p terraform/environments terraform/modules $ unzip $HOME/.local/bin/terraform_0.15.4_darwin_amd64.zip -d $HOME/.local/bin/ Installation of the Terraform binaryĪssume you have python and pip installed and install Ansible : $ pip install -user ansible=2.9.0 Installation of Ansible using pip Install Terraform : $ wget -P $HOME/.local/bin $ unzip $HOME/.local/bin/packer_1.7.2_darwin_amd64.zip -d $HOME/.local/bin Installation of the Packer binary Install Packer: $ wget -P $HOME/.local/bin Adapt versions to your platform architecture. The prerequisites presented here are for MacOSX. Finally, we will create the second Packer manifest to tag and push the image to AWS ECR. A docker-compose file will run the image to ensure all is working well. Then we will create a Packer manifest to build the image on local. We will use Terraform to deploy and configure AWS ECR. The post-processors will build persist the image in the Docker registry. The provisioner will reuse the WordPress role. For both manifests, we will use the Ansible provisioner and Docker post-processors. We will persist the remote image in AWS Elastic Registry (ECR). ![]() ![]() There will be two manifests, one to build the image locally and the other remotely. We will see how to configure Packer through manifests. Here we are going to go further to reuse this work to build the Docker image with Packer. This part was only covered tests using Molecule. This role installs and configures WordPress in a Docker image. In a previous article, we have seen how to create a testable Ansible role with Molecule and Docker. Build Image from Ansible code and persist them on local or in AWS ECR
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |