Ansible playbook显示警告信息的原因可能是什么

Ansible playbook显示警告信息的原因可能是什么,ansible,Ansible,当我运行此Ansible playbook进行灯设置时: --- - name: Setup LAMP server user: ansible hosts: vsrv38 become: yes tasks: - name: Latest version of all required packages installed yum: name: - firewalld - httpd

当我运行此Ansible playbook进行灯设置时:

---
- name: Setup LAMP server 
  user: ansible 
  hosts: vsrv38
  become: yes
  tasks:
    - name: Latest version of all required packages installed
      yum:
        name:
          - firewalld
          - httpd
          - mariadb-server
          - php
          - php-mysql
        state: latest
    - name: Firewalld enabled and running
      service:
        name: firewalld
        enabled: true
        state: started
    - name: Firewalld permits http service
      firewalld:
        service: http
        permanent: true
        state: enabled
        immediate: yes
    - name: Firewalld permits ssh service
      firewalld:
        service: ssh
        permanent: true
        state: enabled
        immediate: yes
    - name: Copy mime.types file
      copy:
        src: /etc/mime.types
        dest: /etc/httpd/conf/mime.types
        remote_src: yes
    - name: Httpd enabled and running
      service:
        name: httpd
        enabled: true
        state: started
    - name: Mariadb enabled and running
      service:
        name: mariadb
        enabled: true
        state: started
    - name: Copy the php page from remote using get_url
      get_url:
        url: "https://www.example.com/index.php"
        dest: /var/www/html/index.php
        mode: 0644
    - name: Test the webpage/website we have setup
      uri:
        url: http://{{ansible_hostname}}/index.php
        status_code: 200
我收到以下警告信息:

[root@vsrv60 ~]# ansible-playbook setup_LAMP-CentOS.yml 
PLAY [Setup LAMP server] *******************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Latest version of all required packages installed] ***********************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Firewalld enabled and running] *******************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Firewalld permits http service] ******************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Firewalld permits ssh service] *******************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Copy mime.types file] ****************************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Httpd enabled and running] ***********************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Mariadb enabled and running] *********************************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Copy the php page from remote using get_url] *****************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
TASK [Test the webpage/website we have setup] **********************************************************************************************************************************
[WARNING]: sftp transfer mechanism failed on [192.168.1.122]. Use ANSIBLE_DEBUG=1 to see detailed information
ok: [vsrv38]
PLAY RECAP *********************************************************************************************************************************************************************
vsrv38                     : ok=10   changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
出现警告的原因可能是什么?我能理解警告是无害的,但我很想知道为什么它会出现。 我从Ansible开始。我可能把事情搞砸了。 提前感谢您提供的任何提示。

请尝试下面的方法

  • 在ansible.cfg中更新以下内容
  • 这也是由于远程主机的sshd_配置中缺少以下行造成的
  • 然后重新加载/重新启动sshd服务

    [ssh_connection]
    scp_if_ssh=True
    
    /etc/ssh/sshd_config:
    Subsystem sftp /usr/libexec/sftp-server