我正在使用ansible,我得到了:
PLAY [webservers-main]
********************************************************************************************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [lxc-server]
TASK [include_vars] ***********************************************************************************************************************************************************************************************
ok: [lxc-server] => (item=/home/jredor/projets/webstore/architecture/provisioning/./distro-vars/Debian-9.yml)
TASK [set_fact] ***************************************************************************************************************************************************************************************************
ok: [lxc-server]
TASK [Disable Magento 2 Cron] *************************************************************************************************************************************************************************************
[WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure. For information on securing this, see
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
fatal: [lxc-server]: FAILED! => {"changed": false, "failed": true, "msg": ""}
to retry, use: --limit @/home/jredor/projets/webstore/architecture/provisioning/install.retry
PLAY RECAP ********************************************************************************************************************************************************************************************************
lxc-server : ok=3 changed=0 unreachable=0 failed=1
我有一个错误,但没有任何消息。由于我是ansible的新手,所以我真的不知道如何解决它。我已遵循警告提供的链接,但对我来说似乎还可以。这是我的install.yml:
---
- hosts: webservers-main
vars:
ansible_user: "{{ magento_project_user }}"
tasks:
- include: includes/include-vars.yml
- include: includes/cron-task.yml
vars:
magento_cron_disabled: true
- name: "Set permissions"
include: includes/permissions-tasks-light.yml
- name: "Set up env.php configuration file"
template:
src: "templates/magento/env_install.php.j2"
dest: "{{ magento_source_path }}/app/etc/env.php"
owner: "{{ magento_project_user }}"
group: "{{ magento_webserver_group }}"
mode: "u=rw,g=rw,o=r"
vars:
magento_cache_database: "{{ magento_cache_database_for_run }}"
- name: "Clear Magento DI and Generation (< 2.2)"
become: yes
become_method: sudo
become_user: "{{ magento_webserver_user }}"
shell: "rm -rf var/di/* var/generation/*"
args:
chdir: "{{ magento_source_path }}"
when: ( magento_version | version_compare('2.2.0', '<') )
- name: "Clear Magento DI and Generation (>= 2.2)"
become: yes
become_method: sudo
become_user: "{{ magento_webserver_user }}"
shell: "rm -rf generated/*"
args:
chdir: "{{ magento_source_path }}"
when: ( magento_version | version_compare('2.2.0', '>=') )
- name: "Install Magento 2"
become: yes
become_method: sudo
become_user: "{{ magento_webserver_user }}"
command: "{{ php_path}} {{ magento_source_path }}/bin/magento setup:install
--admin-firstname={{ magento_admin_firstname }}
--admin-lastname={{ magento_admin_lastname }}
--admin-email={{ magento_admin_email }}
--admin-user={{ magento_admin_user }}
--admin-password={{ magento_admin_password }}
--backend-frontname={{ magento_backend_frontname }}
--db-host={{ magento_db_host }}
--db-name={{ magento_db_name }}
--db-user={{ magento_db_user }}
--db-password={{ magento_db_password }}
--base-url=http://{{ magento_hostname }}/
--base-url-secure=https://{{ magento_hostname }}/
--use-secure={{ magento_secure_frontend }}
--use-secure-admin={{ magento_secure_backend }}
--use-rewrites={{ magento_use_rewrites }}
--currency={{ magento_currency }}
--language={{ magento_language }}
--timezone={{ magento_timezone }}
--cleanup-database
--magento-init-params=\"MAGE_MODE={{ magento_mode }}\"
-vvv"
args:
chdir: "{{ magento_source_path }}"
- include: includes/cron-task.yml
vars:
magento_cron_disabled: false
此文件包含cron-disable.yml,这是触发错误的位置:
- name: "Disable Magento 2 Cron"
become: yes
become_method: sudo
become_user: "{{ magento_webserver_user }}"
cron:
name: "Magento Cron Run"
minute: "*/1"
hour: "*"
job: "{{ magento_cronjob }}"
disabled: true
您能帮我提供链接或示例来解决此问题吗?非常感谢