ansible be_user ไม่ใช้การตั้งค่าสภาพแวดล้อม

---
- name: some playbook
  hosts: remote_host
  become: yes
  become_user: root
  become_method: sudo

  tasks:
    - name: Check environment variables for user1
      become: yes
      become_user: user1
      become_method: sudo 
      shell: "env"
      register: envresult

    - name: debug env
      debug:
        var: envresult.stdout
    - name: Check environment variables for user1
      become: yes
      become_user: user1
      become_method: sudo 
      become_flags: "-i"
      shell: "env"
      register: envresult