Ansible role that will install (& uninstall), configure and runs Besu: an enterprise Java Ethereum Client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-besu/tasks/install.yml

69 lines
1.6 KiB

---
- name: Ensure Besu group exists
group:
name: "{{ besu_group }}"
state: present
become: true
- name: Create Besu user
user:
comment: Besu client user
name: "{{ besu_user }}"
group: "{{ besu_group }}"
become: true
- name: Create base directory
file:
path: "{{ besu_base_dir }}"
state: directory
owner: "{{ besu_user }}"
group: "{{ besu_group }}"
become: true
- name: Create install directory
file:
path: "{{ besu_install_dir }}"
state: directory
owner: "{{ besu_user }}"
group: "{{ besu_group }}"
become: true
- name: Create log directory
file:
path: "{{ besu_log_dir }}"
state: directory
owner: "{{ besu_user }}"
group: "{{ besu_group }}"
become: true
- name: Setup logrotate
template:
src: "logrotate/besu"
dest: "/etc/logrotate.d/besu"
become: true
- name: Extract Besu source to install directory
unarchive:
src: "{{ '/tmp/besu/build/distributions/besu-' + _besu_version + '.tar.gz' if besu_build_from_source else besu_download_url }}"
remote_src: yes
dest: "{{ besu_install_dir }}"
owner: "{{ besu_user }}"
group: "{{ besu_group }}"
mode: '0775'
extra_opts:
- --strip-components
- '1'
become: true
- name: Create a symlink to current
file:
src: "{{ besu_install_dir }}/"
dest: "{{ besu_current_dir }}"
state: link
become: true
register: link_current
- name: Set updated optionally to trigger a systemd restart at the end
set_fact:
besu_state_updates: "{{ besu_state_updates + ['besu.install_dir'] }}"
when: link_current is changed