--- - name: Setting up etcd on the controller nodes hosts: masters vars: etcd_name: kube_etcd etcd_host1: "debian-k8s-master1" etcd_host2: "debian-k8s-master2" etcd_host1_ip: "192.168.11.167" etcd_host2_ip: "192.168.11.94" kube_arch: "{{ 'arm' if ansible_architecture == 'armv7l' else 'amd64' }}" become: true tasks: - name: Copy the etcd binary copy: src: files/x86_64/{{ item }} dest: /usr/local/bin/ mode: 755 with_items: - etcd - etcdctl when: - ansible_architecture == "x86_64" - name: Copy the etcd binary copy: src: files/arm/{{ item }} dest: /usr/local/bin/ mode: 755 with_items: - etcd - etcdctl when: - ansible_architecture == "armv7l" - name: Creating the etcd service file template: src: templates/etcd.service-{{ kube_arch }}.j2 dest: /etc/systemd/system/etcd.service - name: Create the etcd var directory file: path: /var/lib/etcd state: directory - name: Delete any existing etcd contents file: path: /var/lib/etcd/member state: absent - name: Reload systemd command: systemctl daemon-reload - name: Start and enable the etcd service service: name: etcd state: started enabled: true