diff --git a/ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md b/ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md index eb54246..0a26027 100644 --- a/ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md +++ b/ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md @@ -19,4 +19,52 @@ mdp : moutarde42 git: repo: 'https://github.com/arnaudmorin/demo-flask.git' dest: /root/demo-flask +``` + +### Step3 +```yaml +--- +- hosts: demo + gather_facts: yes + tasks: + - name: Install the git package + apt: + name: git + state: present + - name: Clone my flask application + git: + repo: 'https://github.com/arnaudmorin/demo-flask.git' + dest: /root/demo-flask + - name: Install pip + apt: + name: python3-pip + state: present + - name: Install flask requirements + pip: + requirements: /root/demo-flask/requirements.txt +``` + +### Step4 +```yaml +--- +- hosts: demo + gather_facts: yes + tasks: + - name: Install the git package + apt: + name: git + state: present + - name: Clone my flask application + git: + repo: 'https://github.com/arnaudmorin/demo-flask.git' + dest: /root/demo-flask + - name: Install pip + apt: + name: python3-pip + state: present + - name: Install flask requirements + pip: + requirements: /root/demo-flask/requirements.txt + - name: Start the flask application in background + shell: "nohup /root/demo-flask/start.sh &" ``` \ No newline at end of file