错误!冲突的动作语句:dest,get_url [关闭]

问题描述 投票:0回答:0
ERROR! conflicting action statements: dest, get_url

The error appears to be in '/home/ansible/setup-tom.yml': line 22, column 15, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


            - name: download apache tomcat s/w
              ^ here

引发此错误的剧本:

---
# installing software on tomcat
- hosts: webservers
  become: true
  user: ansible
  connection: ssh

  tasks:
            - name: installing java s/w on Redhat
              yum:

                    name: java
                    state: installed
              when: ansible_os_family == "Redhat"

            - name: installing java s/w on Debian
              apt:

                     name: default-jdk
                     state: present
              when: ansible_os_family == "Debian"

            - name: download apache tomcat s/w
              get_url:
                  url: https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.74/bin/apache-tomcat-9.0.74.tar.gz
              dest: /opt


            - name: extract tomcat s/w
              unarchive:
              src: /opt/apache-tomcat-9.0.74.tar.gz
              dest: /opt
              remote_src: yes

            - name: add executable permission for tomcat s/w
              file:
                     path: /opt/apache-tomcat-9.0.74/bin/startup.sh
                     mode: 0777

            - name: start tomcat services
              shell: ./startup.sh nohub
              args:
                   chdir: /opt/apache-tomcat-9.0.74/bin
ansible syntax yaml
© www.soinside.com 2019 - 2024. All rights reserved.