--- # tasks file for wg_vpn # playbook to go from a "base configured" server to a wg vpn peer - hosts: onprem remote_user: josiah gather_facts: True vars: source_os: arch tasks: - name: "generating config on relay server" debug: msg: "config on relay is starting" verbosity: 1 - name: generate config on relay server include: pretasks_debian.yml become: yes - name: "generating config on local mac" debug: msg: "config on mac is starting" verbosity: 1 when: source_os == 'macos' - name: generate config on local mac include: pretasks_mac.yml delegate_to: localhost when: source_os == 'macos' - name: "generating config on local arch" debug: msg: "config on arch is starting" verbosity: 1 when: source_os == 'arch' - name: generate config on local arch include: pretasks_arch.yml delegate_to: localhost when: source_os == 'arch' - name: generate config for IOS on local machine include: pretasks_ios.yml delegate_to: localhost - name: "completing config on server" debug: msg: "config on relay is resuming" verbosity: 1 - name: complete config, wg up on relay server include: posttasks_debian.yml become: yes - name: complete config, wg up on local mac include: posttasks_mac.yml delegate_to: localhost when: source_os == 'macos' - name: "generating config on local arch" debug: msg: "config on arch is completing" verbosity: 1 when: source_os == 'arch' - name: complete config on local arch include: posttasks_arch.yml delegate_to: localhost when: source_os == 'arch' - name: "generating config for iOS" debug: msg: "config for IOS is completing" verbosity: 1 - name: complete config for IOS on local machine include: posttasks_ios.yml delegate_to: localhost