diff --git a/.ansible/cluster.yaml b/.ansible/cluster.yaml new file mode 100644 index 0000000..417642b --- /dev/null +++ b/.ansible/cluster.yaml @@ -0,0 +1,13 @@ +--- +# - name: Install tailscale +# hosts: k3s_cluster +# roles: +# - role: artis3n.tailscale.device +# vars: +# tailscale_up_skip: true +- name: Build a cluster + hosts: k3s_cluster + vars: + k3s_become: true + roles: + - role: xanmanning.k3s diff --git a/.ansible/inventory.yaml b/.ansible/inventory.yaml new file mode 100644 index 0000000..174dce3 --- /dev/null +++ b/.ansible/inventory.yaml @@ -0,0 +1,30 @@ +--- +k3s_cluster: + hosts: + oracle-master-1: + ansible_host: 130.61.173.37 + k3s_control_node: true + k3s_server: + # write-kubeconfig-mode: 777 + write-kubeconfig-mode: 777 + vpn-auth: "name=tailscale,controlServerURL=https://headscale.kmsign.ru,joinKey=544cd542cee22ea076d01c2d87b9cc606525b31fe966b168,extraArgs=--advertise-tags=tag:cloud-cluster" + advertise-address: "130.61.173.37" + tls-san: + - "130.61.173.37" + + murino-worker-1: + ansible_user: root + ansible_host: 192.168.220.17 + k3s_agent: + vpn-auth: "name=tailscale,controlServerURL=https://headscale.kmsign.ru,joinKey=544cd542cee22ea076d01c2d87b9cc606525b31fe966b168,extraArgs=--advertise-tags=tag:cloud-cluster" + + # kube-2: + # ansible_host: 152.70.184.40 + # k3s_state: uninstalled + + vars: + ansible_port: 22 + ansible_user: ubuntu + ansible_python_interpreter: /usr/bin/python3 + k3s_server: + write-kubeconfig-mode: 777 diff --git a/.ansible/requirements.yml b/.ansible/requirements.yml new file mode 100644 index 0000000..badff17 --- /dev/null +++ b/.ansible/requirements.yml @@ -0,0 +1,8 @@ +collections: + - name: ansible.utils + - name: community.general + - name: ansible.posix + - name: kubernetes.core + - name: artis3n.tailscale +roles: + - name: xanmanning.k3s diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6a785bf --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "yaml.schemas": { + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/playbook": "file:///home/royalcat/projects/cloud-cluster/.ansible/cluster.yaml", + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json": "file:///home/royalcat/projects/cloud-cluster/.ansible/inventory.yaml" + } +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d4f5f73 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +ansible-k3s-site: + ansible-playbook cluster.yaml -i inventory.yaml \ No newline at end of file