[FRA]
bonjour j’ai un script qui ne fonctionne pas étrangement alors q’un autre script fonctionne.
j’ai ansible-playbook.yml à la version suivante : 2.17.5
un script nommé playbook.yml fonctionne mais pas le deuxième : playbookDeux.yml
, mais je ne sais pas pourquoi voici le code yml des deux scripts avec leurs permissions (voir ci dessous):
pourriez vous m’aider ?
[ENG]
hello I have a script that doesn’t work strangely so that another script works.
I have ansible-playbook.yml in the following version: 2.17.5
a script named playbook.yml works but not the second one: playbookDeux.yml
, but I don’t know why here is the yml code of the two scripts with their permissions (see below):
could you help me ?
[DE]
hallo Ich habe ein Skript, das nicht seltsam funktioniert, so dass ein anderes Skript funktioniert.
Ich habe ansible-playbook.yml in der folgenden Version: ‘2.17.5’, ein Skript namens playbook.yml funktioniert, aber das zweite funktioniert nicht: ‘playbookDeux.yml’, aber ich weiß nicht warum hier ist der yml-Code der beiden Skripte mit ihren Berechtigungen (siehe unten):
Sie können mir helfen?
[ITA]
ciao ho uno script che non funziona stranamente così c’è un altro script che funziona.
ho ansible-playbook.yml alla seguente versione: ‘2.17.5’uno script chiamato playbook.yml funziona ma non il secondo: ‘playbookDeux.yml’, ma non so perché qui c’è il codice yml dei due script con i loro permessi (vedi sotto):
potrebbe darmi una mano?
[SPA]
hola Tengo un script que no funciona extrañamente por lo que otro script funciona.
tengo ansible-playbook.yml en la siguiente versión: ‘2.17.5‘un script llamado playbook.yml funciona pero no el segundo: ‘playbookDeux.yml’, pero no sé por qué aquí está el código yml de los dos scripts con sus permisos (ver abajo):
Me puede ayudar?
[CHI]
你好,我有一个脚本,它不会奇怪地工作,因此另一个脚本可以工作。
我有以下版本的 ansible-playbook。yml:2。17。5
一个名为 playbook。yml 的脚本可以运行,但第二个脚本不行:playbookDeux。yml
,但我不知道为什么这里是两个脚本的 yml 代码及其权限(见下文):
你能帮助我吗?
[JAP]
こんにちは私は別のスクリプトが動作するように奇妙に動作しないスクリプトを持っています。
次のバージョンでは ansible-playbook。yml を持っています: 2。17。5
a script name playbook。yml works ではなく、2 番目の作品: playbookDeux。yml
, しかし、なぜここに 2 つのスクリプトの yml コードが許可されているのかわかりません(下記を参照):
playbook.yml
,
les permissions de ces fichiers sont celles ci :
助けてくれないか?
(env) alexandre@alexandre-Matebook:~/Documents/AnalyticaTechCode/ansible$ ls -la ./
total 36
drwxr-xr-x 5 alexandre alexandre 4096 juil. 6 12:24 .
drwxrwxrwx 18 alexandre alexandre 4096 juil. 2 21:19 ..
-rw-r--r-- 1 alexandre alexandre 238 nov. 14 2024 ansible.cfg
drwxrwxr-x 5 alexandre alexandre 4096 nov. 4 2024 env
drwxrwxrwx 3 alexandre alexandre 4096 nov. 14 2024 group_vars
drwxrwxrwx 2 alexandre alexandre 4096 nov. 1 2024 host_vars
-rw-r--r-- 1 alexandre alexandre 176 nov. 14 2024 inventory.ini
-rwxrwxrwx 1 alexandre alexandre 1093 juil. 6 12:20 playbookDeux.yml
-rwxrwxrwx 1 alexandre alexandre 3026 juil. 2 21:36 playbook.yml
(env) alexandre@alexandre-Matebook:~/Documents/AnalyticaTechCode/ansible$
- hosts: servers
become: yes
vars:
symfony_root: /var/www/AnalyticaTechCode
local_project_root: "/home/alexandre/Documents/AnalyticaTechCode"
tasks:
- debug:
msg: "Ansible version: {{ ansible_version.full }}"
- name: Ensure directory exists
file:
path: "{{ symfony_root }}"
state: directory
owner: alexandre
group: www-data
mode: '0755'
- name: Ensure correct permissions on symfony_root
file:
path: "{{ symfony_root }}"
state: directory
owner: alexandre
group: www-data
mode: '0775'
recurse: yes
- name: Ensure /var/www has correct permissions
become: yes
file:
path: /var/www
state: directory
owner: www-data
group: www-data
mode: '0755'
# - name: Create Ansible temp directory
# become: yes
# file:
# path: /var/www/.ansible/tmp
# state: directory
# owner: www-data
# group: www-data
# mode: '0755'
- name: Synchronize project files
ansible.posix.synchronize:
src: "{{ local_project_root }}/"
dest: "{{ symfony_root }}"
delete: no # Ne pas supprimer les fichiers qui n'existent pas dans la source
rsync_opts:
- "--exclude=.git"
- "--exclude=*.sh"
- "--exclude=/vendor"
- "--exclude=var/cache/*" # Pour éviter de synchoniser le cache local
- "--exclude=var/log/*" # Pour éviter de synchoniser les logs locaux
- "--exclude=.env.local" # Pour préserver le fichier .env.local de prod
- "-v"
delegate_to: localhost
become: no
- name: Set final permissions
file:
path: "{{ symfony_root }}"
state: directory
owner: www-data
group: www-data
mode: '0755'
recurse: yes
- name: Vérifier le PATH
debug:
msg: "/usr/local/bin:{{ ansible_env.PATH }}"
- name: Ensure migrations directory exists
file:
path: "{{ symfony_root }}/migrations"
state: directory
owner: www-data
group: www-data
mode: '0755'
become: no
- name: Run composer update
become: yes
become_user: www-data # ou l'utilisateur approprié
shell: |
set -o pipefail
cd {{ symfony_root }} && \
COMPOSER_ALLOW_SUPERUSER=1 composer update
args:
executable: /bin/bash
environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
- name: Clear Symfony cache
become: yes
become_user: www-data
shell: cd {{ symfony_root }} && symfony console cache:clear --env=prod
args:
executable: /bin/bash
- name: Vérifier le PATH
debug:
msg: "/usr/local/bin:{{ ansible_env.PATH }}"
# - name: Restart PHP-FPM
# service:
# name: php8.3-fpm # Ajustez selon votre version
# state: restarted
et playbookDeux.yml
:
- hosts: servers
become: yes
vars:
symfony_root: /var/www/AnalyticaTechCode
local_project_root: "/home/alexandre/Documents/AnalyticaTechCode"
tasks:
- debug:
msg: "Ansible version: {{ ansible_version.full }}"
- name: Synchronize project files
ansible.posix.synchronize:
src: "{{ local_project_root }}/"
dest: "{{ symfony_root }}"
delete: no # Ne pas supprimer les fichiers qui n'existent pas dans la source
rsync_opts:
- "--exclude=.git"
- "--exclude=*.sh"
- "--exclude=/vendor"
- "--exclude=var/cache/*" # Pour éviter de synchoniser le cache local
- "--exclude=var/log/*" # Pour éviter de synchoniser les logs locaux
- "--exclude=.env.local" # Pour préserver le fichier .env.local de prod
- "-v"
delegate_to: localhost
become: no
- name: Clear Symfony cache
become: yes
become_user: www-data
shell: cd {{ symfony_root }} && symfony console cache:clear --env=prod
args:
executable: /bin/bash
errors: -js/stable/get-iterator.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/global-this.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/index.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/is-iterable.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/parse-float.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/parse-int.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/queue-microtask.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/self.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/set-immediate.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/set-interval.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/set-timeout.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/structured-clone.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/suppressed-error.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/unescape.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/constructor.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/detached.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/index.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/is-view.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/slice.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/transfer-to-fixed-length.js\" failed: Operation not permitted (1)\nrsync: [generator] chgrp \"/var/www/AnalyticaTechCode/node_modules/core-js/stable/array-buffer/transfer.js\" failed: Operation not permitted (1)\nrsync: