私のローカルホストからApache httpをダウンロードするAnsible YAML Playbookの構文エラー

私のローカルホストからApache httpをダウンロードするAnsible YAML Playbookの構文エラー
---
- hosts: test_server
  remote_user: root
  tasks:
    - name: extract tar file
      command: tar -xvzf httpd-2.4.41.tar.gz 
    - name: go to the extracted directory
      command: cd httpd-2.4.41
    - name: Run below commands
      command:
         - ./configure --prefix=instance --with-mpm=worker --enable-proxy -enable-deflate --enable-proxy-balancer --enable-rewrite --enable-apr -enable-apr-util --enable-ssl --enable-setenvif --with-ssl=/usr/local/ssl 
         - make
         - make install
     - name: change directory
       command: cd
     - name: check version
       command: /app/apache/instance/bin/apachectl -v
     - name: start httpd
       command: /app/apache/instance/bin/apachectl start  

しかし、次のエラーが発生しました。

[root@91c2ebbd3d57 ~]# ansible-playbook test.yml
ERROR! Syntax Error while loading YAML.
  did not find expected '-' indicator

エラーは "/root/test.yml": 14行目、6列目にあるようですが、正確な構文の問題によっては、ファイルの他の場所にある可能性があります。

問題のある行は次のとおりです。

     - make install
 - name: change directory
 ^ here

ベストアンサー1

この試み

---
- hosts: test_server
  remote_user: root
  tasks:

  - name: extract tar file
    command: tar -xvzf httpd-2.4.41.tar.gz 

  - name: Run below commands
    shell: |
      ./configure \
      --prefix=instance \
      --with-mpm=worker \
      --enable-proxy \
      --enable-deflate \
      --enable-proxy-balancer \
      --enable-rewrite \
      --enable-apr \
      --enable-apr-util \
      --enable-ssl \
      --enable-setenvif \
      --with-ssl=/usr/local/ssl 
      make
      make install
    args:
      chdir: /root/httpd-2.4.41

  - name: check version
    command: /app/apache/instance/bin/apachectl -v

  - name: start httpd
    command: /app/apache/instance/bin/apachectl start`

おすすめ記事