diff --git a/netmaker/meta/main.yml b/netmaker/meta/main.yml new file mode 100644 index 0000000..3b2d8d8 --- /dev/null +++ b/netmaker/meta/main.yml @@ -0,0 +1,3 @@ +--- + dependencies: + - role: docker diff --git a/netmaker/tasks/install.yml b/netmaker/tasks/install.yml new file mode 100644 index 0000000..239dfec --- /dev/null +++ b/netmaker/tasks/install.yml @@ -0,0 +1,25 @@ +- name: Install Packages +# when: docker_file.stat.exists == False + package: + name: + - gpg + - gpg-agent + +- name: Add netmaker-key + apt_key: + url: https://apt.netmaker.org/gpg.key + state: present + +- name: Add netmaker-repository + apt_repository: + repo: "deb https:apt.netmaker.org stable main" + state: present + filename: netmaker + update_cache: yes + +- name: Install wireguard & netclient + package: + name: + - wireguard + - netclient + state: latest diff --git a/netmaker/tasks/join-network.yml b/netmaker/tasks/join-network.yml new file mode 100644 index 0000000..b57ad1a --- /dev/null +++ b/netmaker/tasks/join-network.yml @@ -0,0 +1,4 @@ +- name: Join netmaker-network + when: "netclient.join_network_token is defined" + command: "netclient join -t {{ netclient.join_network_token }}" + failed_when: command.rc != 0 diff --git a/netmaker/tasks/main.yml b/netmaker/tasks/main.yml new file mode 100644 index 0000000..78b8f81 --- /dev/null +++ b/netmaker/tasks/main.yml @@ -0,0 +1,5 @@ +- import_tasks: ./prerequisites.yml + +- import_tasks: ./install.yml + +- import_tasks: ./join-network.yml diff --git a/netmaker/tasks/prerequisites.yml b/netmaker/tasks/prerequisites.yml new file mode 100644 index 0000000..e69de29