--- - name: Ensure xray config directory exists file: path: /app-config/xray state: directory mode: '0750' - name: Copy xray client config copy: src: "{{ xray_config_path }}" dest: /app-config/xray/client.json mode: '0640' notify: restart xray-client - name: Pull xray image community.docker.docker_image: name: "{{ xray_image }}" source: pull - name: Start xray-client container community.docker.docker_container: name: "{{ xray_container_name }}" image: "{{ xray_image }}" state: started restart_policy: unless-stopped network_mode: host volumes: - "/app-config/xray/client.json:/etc/xray/config.json:ro"