| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- ---
- - name: Bootstrap Python on all hosts
- hosts: all
- gather_facts: false
- become: true
- tasks:
- - name: Install Python 3
- ansible.builtin.raw: apt-get update && apt-get install -y python3
- changed_when: false
- - name: Base server setup (all hosts)
- hosts: all
- roles:
- - base
- - geoblock
- - name: Deploy Shadowsocks on relay server
- hosts: relay
- roles:
- - shadowsocks
- - name: Deploy Trojan on landing server
- hosts: landing
- roles:
- - trojan
- - name: Generate Surge client configuration
- hosts: localhost
- connection: local
- gather_facts: no
- tasks:
- - name: Create output directory
- ansible.builtin.file:
- path: output
- state: directory
- mode: "0755"
- - name: Render Surge client config
- ansible.builtin.template:
- src: templates/surge-client.conf.j2
- dest: output/surge-client.conf
- mode: "0600"
- - name: Display Surge config location
- ansible.builtin.debug:
- msg: "Surge client config generated at: output/surge-client.conf"
|