diff --git a/meta/main.yml b/meta/main.yml index fefb9de..861b20e 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,6 @@ --- galaxy_info: - author: PegaSysEng + author: PegaSysEng role_name: hyperledger-besu description: Besu is an open-source java enterprise ethereum client company: PegaSysEng diff --git a/tasks/compile.yml b/tasks/compile.yml index 31ec2c2..c6ac312 100644 --- a/tasks/compile.yml +++ b/tasks/compile.yml @@ -8,12 +8,13 @@ - name: Check JDK version shell: javac -version | egrep -o '[0-9]+\.[0-9]+\.[0-9]+' register: jdk_version + changed_when: false ignore_errors: true - name: Ensure JDK is installed fail: msg: "You must have JDK 11 or later installed. {{ 'No version found.' if jdk_version is failed else 'Found version ' + jdk_version.stdout }}" - when: jdk_version.stdout is version('11.0.0', '<') + when: jdk_version.stdout is version('11.0.0', '<') - name: Clone Besu Sources git: @@ -22,15 +23,17 @@ version: "{{ besu_git_commit }}" - name: Build Besu - shell: ./gradlew --no-daemon --parallel clean assemble + command: ./gradlew --no-daemon --parallel clean assemble args: chdir: /tmp/besu + changed_when: true - name: Get Besu Version shell: "awk '/version=/ { gsub(/version=/,\"\"); print $1 }' gradle.properties" args: chdir: /tmp/besu register: besu_version_cmd + changed_when: false - name: Set Besu Version Fact set_fact: diff --git a/tasks/main.yml b/tasks/main.yml index a8db28a..0b43a81 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,13 +1,19 @@ --- - name: Ensure we have sane configuration block: - - fail: + - name: Check besu_version is correct + fail: msg: You must set "besu_version" for this role to run when not building Besu from source when: besu_version is not defined and not besu_build_from_source - - fail: - msg: The vars "besu_version" and "besu_build_from_source" are incompatible. If trying to build a specific git refspec, use "besu_git_refspec" instead of besu_version. + - name: Check besu_version is not set when besu_build_from_source is set + fail: + msg: >- + The vars "besu_version" and "besu_build_from_source" are + incompatible. If trying to build a specific git refspec, use + "besu_git_refspec" instead of besu_version. when: besu_version is defined and besu_build_from_source - - fail: + - name: Check orion_version is not set when fast sync is enabled + fail: msg: Orion and Fast-Sync are incompatible when: orion_version is defined and besu_sync_mode == "FAST" diff --git a/tasks/network.yml b/tasks/network.yml index 109795b..b225a5b 100644 --- a/tasks/network.yml +++ b/tasks/network.yml @@ -1,7 +1,10 @@ --- - name: Get the default ipv4 address set_fact: - besu_default_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] if hostvars[inventory_hostname]['ansible_default_ipv4']['address'] is defined else '127.0.0.1' }}" + besu_default_ip: >- + {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] if + hostvars[inventory_hostname]['ansible_default_ipv4']['address'] is + defined else '127.0.0.1' }} besu_aws_public_ip: "" besu_gcp_public_ip: "" besu_azure_public_ip: ""