You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Auriane GS 38dcba998a fix(doc + back): fix vars and wording 1 month ago
README.md fix(doc + back): fix vars and wording 1 month ago
inventory.ini featb(back): launch ansible playbook with inventory with privte key 1 month ago
site.yml fix(doc + back): fix vars and wording 1 month ago

README.md

Présentation

Ce projet met à disposition un exemple de déploiement d'une application sur un serveur avec Nginx et ajout d'un certificat Let's Encrypt avec Certbot.

Installation Ansible

Vous devez avoir Python3 installé sur votre machine.

Créez un environnement virtuel Python à la racine du projet :

python3 -m venv ./venv

Activez l'environnement virtuel :

source venv/bin/activate

Une fois activé installez Ansible :

pip install ansible

Configuration

Dans inventory.ini renseignez les valeurs demandée. Exemple :

vultr ansible_host=192.168.30.60 ansible_user=admin ansible_ssh_private_key_file=~/.ssh/id_rsa

Dans site.yml remplacez les valeurs d'environnement par les votres :

  vars:
    web_root: /var/www/html
    php_version: "8.3"
    domain: cube3.cesi.fr
    email_ssl: mail@viacesi.fr

Pour déployer une application le dossier du site attendu est out maisq vous pouvez très bien le changer :

    - name: Copier le dossier de l'application vers le serveur
      copy:
        src: out/ # ICI
        dest: "{{ web_root }}"
        owner: www-data
        group: www-data
        mode: '0755'

Lancement script Ansible

Enfin lancez la commande :

ansible-playbook -i inventory.ini site.yml