On 1/21/20 10:34 AM, Sandy Hung wrote:
> ---
> - hosts: all
>   remote_user: sandy
>   become: true
> 
>   tasks:
> 
>    - name: install phpldapadmin
>      apt: name=phpldapadmin update_cache=yes
> 
>    - name: install phpopenldap
>      apt:
>        name: '{{item.name}}'
>        state: '{{item.state | default("present")}}'
>        purge: yes
>      with_items:
> 
>       - name: php
>       - name: libapache2-mod-php
>       - name: mcrypt
>       - name: php-mysql
> 
>    - name: Force certbot to use Python 3
>      lineinfile:
>        path: '{{ item }}'
>        regexp: '^#!/usr/bin/python$'
>        line: '#!/usr/bin/python3'
>      with_items:
>       - /usr/local/bin/certbot
>       - /usr/bin/certbot
>      ignore_errors: yes
>      failed_when: no
> 
>    - name: stat phpldapadmin
>      stat: path=/var/www/html/
>      register: phpldapadmin_stat
> 
>    - name: Move phpldapadmin
>      shell: mv /var/www/html/ /var/www/html/
>      when: phpldapadmin_stat.stat.exists
> 
>      vars:
>        certbot_generate_certificates: true
>        certbot_register_email: x...@xxxx.com
>        certbot_certificate_domains:
>          - xxxxx.com
> 
>      roles:
>          - {role: certbot-apache, become: yes }
>          - role: letsencrypt
>            letsencrypt_webroot_pah: /var/www/html
>            letsencrypt_email: x...@xxxx.com
>            letsencrypt_cert_domains:
>             - ldaptest.xxx.com
>             - xxx.com
>            letsencrypt_renewal_command_args: '--renew-hook "systemctl restart 
> apache"'

Use include_role or import_role.

Regards
           Racke

> 
>    - name: Allow everything and enable UFW
>      ufw:
>       state: enabled
>      policy: allow
> 
> 
> On Tuesday, January 21, 2020 at 5:24:29 PM UTC+8, Stefan Hornburg (Racke) 
> wrote:
> 
>     On 1/21/20 10:09 AM, Sandy Hung wrote:
>     > Dear All:
>     >
>     > I don't know this error is?
>     > can hlep me thanks.
>     >
>     >
>     > ERROR! conflicting action statements: lineinfile, roles
>     >
>     > The error appears to be in '/home/sandy/phpldapadmin.yml': line 54, 
> column 6, but may
>     > be elsewhere in the file depending on the exact syntax problem.
>     >
>     > The offending line appears to be:
>     >
>     >
>     >    - name: Force certbot to use Python3
>     >      ^ here
>     >
>     >
>     >
>     >    - name: Force certbot to use Python3
>     >      lineinfile:
>     >         path: '{{ item }}'
>     >         regexp: '^#!/usr/bin/python$'
>     >         line: '#!/usr/bin/python3'
>     >      with_items:
>     >         - /usr/local/bin/certbot
>     >         - /user/bin/certbot
>     >      ignore_errors: yes
>     >      failed_when: no
> 
>     Please show your complete playbook, especially the part where "roles" 
> appears.
> 
>     Regards
>               Racke
> 
>     >
>     > --
>     > You received this message because you are subscribed to the Google 
> Groups "Ansible Project" group.
>     > To unsubscribe from this group and stop receiving emails from it, send 
> an email to
>     > ansible...@googlegroups.com <javascript:> 
> <mailto:ansible-project+unsubscr...@googlegroups.com <javascript:>>.
>     > To view this discussion on the web visit
>     > 
> https://groups.google.com/d/msgid/ansible-project/2b8e28c9-bd13-44eb-83a2-f55b27aeb97c%40googlegroups.com
>     
> <https://groups.google.com/d/msgid/ansible-project/2b8e28c9-bd13-44eb-83a2-f55b27aeb97c%40googlegroups.com>
>     >
>     
> <https://groups.google.com/d/msgid/ansible-project/2b8e28c9-bd13-44eb-83a2-f55b27aeb97c%40googlegroups.com?utm_medium=email&utm_source=footer
>     
> <https://groups.google.com/d/msgid/ansible-project/2b8e28c9-bd13-44eb-83a2-f55b27aeb97c%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> 
> 
> 
>     -- 
>     Ecommerce and Linux consulting + Perl and web application programming.
>     Debian and Sympa administration. Provisioning with Ansible.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to
> ansible-project+unsubscr...@googlegroups.com 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/58a13ddb-153c-4040-99a4-9c44e6a31163%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/58a13ddb-153c-4040-99a4-9c44e6a31163%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80f714fc-6c74-9bc5-290f-db4e931f7682%40linuxia.de.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to