Ansible 2.4跳过选项

Ansible 2.4跳过选项,ansible,Ansible,我正在尝试安装一个带有ansible 2.4.0.0的网站。当我这样做时: ./architecture/scripts/provision.sh lxc 我得到这个结果: /usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Supp

我正在尝试安装一个带有ansible 2.4.0.0的网站。当我这样做时:

 ./architecture/scripts/provision.sh lxc
我得到这个结果:

/usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  CryptographyDeprecationWarning,
/usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  CryptographyDeprecationWarning,
 [WARNING]: - ansible-genericservice was NOT installed successfully: - command git clone git@git.smile.fr:ansible/ansible-genericservice.git ansible-genericservice failed in directory /tmp/tmpmZfdUa (rc=128)

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
/usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  CryptographyDeprecationWarning,
[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions. This feature will be removed in a future release. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: include is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be removed in a 
future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

PLAY [dbservers,cacheservers,searchservers,webservers] ************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
Warning: the ECDSA host key for 'webstore.lxc' differs from the key for the IP address '10.124.193.20'
Offending key for IP in /home/jredor/.ssh/known_hosts:19
Matching host key in /home/jredor/.ssh/known_hosts:21
Are you sure you want to continue connecting (yes/no)? yes
ok: [lxc-server]

TASK [include_vars] ***********************************************************************************************************************************************************************************************
fatal: [lxc-server]: FAILED! => {"failed": true, "msg": "No file was found when using with_first_found. Use the 'skip: true' option to allow this task to be skipped if no files are found"}
    to retry, use: --limit @/home/jredor/projets/webstore/architecture/provisioning/provision.retry

PLAY RECAP ********************************************************************************************************************************************************************************************************
lxc-server                 : ok=1    changed=0    unreachable=0    failed=1   
我找不到如何将skip选项传递为true。我的ansible文件如下所示:

    cd "$( dirname "${BASH_SOURCE[0]}" )"
cd ..

source scripts/_environment-with-lxc.sh
source scripts/_ansible.sh

ansible-galaxy install -r provisioning/requirements.yml -p provisioning/roles -n -f
ansible-playbook --ssh-extra-args="${ANSIBLE_SSH_ARGS}" provisioning/provision.yml -i provisioning/inventory/$inventory
exit $?
这是我第一次使用ansible,所以我迷路了。 谢谢

编辑: 下面是provision.yml中的代码

---
# load variables for each servers
- hosts:
    - dbservers
    - cacheservers
    - searchservers
    - webservers
  vars:
    ansible_user: "root"
  tasks:
    - include: includes/include-vars.yml

# Prepare the delivery authorized keys
- hosts:
    - dbservers
    - cacheservers
    - searchservers
    - webservers
  connection: local

  vars:
    ansible_user: "root"
    tmp_delivery_users:
      - name:   "{{ magento_project_user }}"
        group:  "{{ magento_webserver_group }}"
        authorized_keys: "{{ delivery_authorized_keys }}"

  tasks:
    - name: "Prepare the list of the authorized keys for delivery - Extra Keys"
      set_fact: delivery_authorized_keys="{{ delivery_authorized_extra_keys }}"

    - name: "Prepare the delivery_users object"
      set_fact: delivery_users="{{ tmp_delivery_users }}"

# add hosts alias on Servers
- hosts:
    - dbservers
    - cacheservers
    - searchservers
    - webservers
  vars:
    ansible_user: "root"
  tasks:
    - include: includes/init-hosts.yml
      with_items: "{{ specific_hosts|default([]) }}"

# add magento hosts alias on WebServers
- hosts:
    - webservers
  vars:
    ansible_user: "root"
  tasks:
    - include: includes/init-hosts.yml
      with_items: "{{ magento_server_alias|default([]) }}"

# Generic behaviors on all servers
- hosts:
    - dbservers
    - cacheservers
    - searchservers
    - webservers
  vars:
    ansible_user: "root"
  roles:
    - role: ansible-basicserver

# Generic usage of the ansible roles - DB Server
- hosts: dbservers
  vars:
    ansible_user: "root"
  roles:
    - role: ansible-mysql-server

# Generic usage of the ansible roles - Cache Server
- hosts: cacheservers
  vars:
    ansible_user: "root"
  roles:
    - {
        role: ansible-redis,
        redis_instance_name: "magento_cache",
        redis_setting_port:  "{{ magento_cache_port }}",
        redis_setting_save:  "{{ redis_setting_save_cache }}"
      }
    - {
        role: ansible-redis,
        redis_instance_name: "magento_session",
        redis_setting_port:  "{{ magento_cache_session_port }}",
        redis_setting_save:  "{{ redis_setting_save_session }}"
      }

# Generic usage of the ansible roles - Search Server
- hosts: searchservers
  vars:
    ansible_user: "root"
  roles:
    - role: ansible-elasticsearch

# Prepare php parameters
- hosts: webservers
  vars:
    ansible_user: "root"
  tasks:
    - include: includes/prepare-php-parameters.yml

# Generic usage of the ansible roles - Webserver Server
- hosts: webservers
  vars:
    ansible_user: "root"
  roles:
    - role: ansible-php
    - role: ansible-apache
    - role: ansible-varnish
    - role: ansible-nginx

# Specific usage of the ansible roles - Webserver Server - Dev Tools
- hosts: webservers
  vars:
    ansible_user: "root"
  roles:
    - { role: ansible-npm, when: magento_install_maildev or magento_install_grunt }
    - { role: ansible-maildev, when: magento_install_maildev }

  tasks:
  - name: "Install NPM package: grunt-cli"
    npm: name="grunt-cli" global=yes
    when: magento_install_grunt

  - name: "Add delivery user in groups"
    user:
      name: "{{ magento_project_user }}"
      groups: "{{ magento_delivery_groups }}"

  - name: "Create {{ magento_source_path }} folder"
    file:
      path:  "{{ magento_source_path }}"
      state: directory
      owner: "{{ magento_project_user }}"
      group: "{{ magento_project_group }}"
      mode:  "u=rwX,g=rX,o=rX"

# Specific task for Magento 2
  - name: "Check if Magento app/etc/env.php exists"
    stat:
      path: "{{ magento_source_path }}/app/etc/env.php"
    register: magento_app_etc_env

  - name: "Update app/etc/env.php configuration file"
    template:
      src: "templates/magento/env.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 }}"
    when: magento_app_etc_env.stat.exists

# Update permissions
  - include: includes/permissions-tasks-full.yml

它是由一位同事编写的,我只是想用它在我的电脑上发布网站。所以我想我必须把“跳过:真的”放在这里,但我真的不知道在哪里,对不起。谢谢你的帮助

您可以指定
跳过
选项作为失败查找中的参数,

provision.yml
中指定了什么?谢谢您的回答。我用provision.yml中的代码编辑了我以前的帖子。谢谢你的回答。但正如我所说的,我不知道ansible,也不知道查找失败的原因是什么,我的文件中似乎没有一个,以您的示例为例,我不知道它在哪里使用了skip选项。你能解释一下吗?我找到了放跳绳的地方:真的。但是我得到了错误:致命:[lxc服务器]:失败!=>{“changed”:false,“failed”:true,“module_stderr”:“/bin/sh:1:/usr/bin/python:notfound\n”,“module_stdout”:““msg”:“module FAILURE”,“rc”:0}