Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I want to remind you that the goal of this tutorial series is to document what I consider the bare minimum for a small self-hosted side project. I invite you to visit my repository for more information: https://github.com/xNok/infra-bootstrap-tools. At this point, we are doing the groundwork of setting up a server to host the application we will deploy later as docker containers.
################################################# # OR INFRA Role: Docker Swarm Manager # Source: # https://github.com/arillso/ansible.traefik # https://geek-cookbook.funkypenguin.co.nz/ha-docker-swarm/traefik/ ################################################# --- ### # GENERAL Setup ### ### # SWARM Setup ### - name: Init a new swarm with default parameters docker_swarm: state: present advertise_addr: "{{ ansible_host }}" register: result when: inventory_hostname == groups[swarm_managers_inventory_group_name][0] # only on the first manager ### # Manager Setup ### - name: Get join-token for manager nodes set_fact: join_token_manager: "{{ hostvars[groups[swarm_managers_inventory_group_name][0]].result.swarm_facts.JoinTokens.Manager }}" - name: Join other managers docker_swarm: state: join join_token: "{{ join_token_manager }}" advertise_addr: "{{ ansible_host }}" remote_addrs: "{{ groups[swarm_managers_inventory_group_name] | map('extract', hostvars, ['ansible_host']) | join(',') }}" when: inventory_hostname != groups[swarm_managers_inventory_group_name] # exclude the first manager