We are now going to perform our first deployment of the web application from a revision control system (Git) directly to our server using Ansible. So, we are going to deploy a simple PHP application that will be composed of only a single PHP page. The source is available at the following repository: https://github.com/Fale/demo-php-app.
To deploy it, we will need the following code placed in playbooks/manual/rcs_deploy.yaml:
- hosts: web
user: vagrant
tasks:
- name: Ensure git is installed
yum:
name: git
state: present
become: True
- name: Install or update website
git:
repo: https://github.com/Fale/demo-php-app.git
dest: /var/www/application
become: True
We can now run the deployer with the following command:
ansible-playbook -i inventory/production/playbooks/manual...