--- {%- from "etcd/map.jinja" import etcd with context %} etcd-user: user.present: - name: {{ etcd.runuser }} - shell: /bin/nologin etcd-archive-extract: archive.extracted: - name: {{ etcd.release_dir }}/etcd-{{ etcd.version }} - source: {{ etcd.mirror }}/v{{ etcd.version }}/etcd-v{{ etcd.version }}-{{ etcd.os }}-{{ etcd.arch }}.tar.gz - user: {{ etcd.runuser }} - enforce_toplevel: false - skip_verify: true - archive_format: tar - options: --strip 1 - if_missing: {{ etcd.release_dir }}/etcd-{{ etcd.version }} - watch_in: - service: etcd-service etcd-bin-symlink: file.symlink: - name: {{ etcd.install_dir }}/etcd - target: {{ etcd.release_dir }}/etcd-{{ etcd.version }} - user: {{ etcd.runuser }} - force: true - watch_in: - service: etcd-service etcd-data-dir: file.directory: - name: {{ etcd.config.get('data-dir') }} - user: {{ etcd.runuser }} - watch_in: - service: etcd-service etcd-cleanup: software.cleanup: - name: etcd - path: {{ etcd.release_dir }} - version: "{{ etcd.version }}"