- name: "Launch Geth Bootnodes" hosts: "{{ 'tag_Role_' + lookup('env', 'NUCYPHER_NETWORK_NAME') + '_bootnodes' }}" user: ubuntu gather_facts: false pre_tasks: - name: "Install Python2.7 for Ansible Control" raw: sudo apt -y update && sudo apt install -y python2.7-minimal python2.7-setuptools tasks: - name: "Register Ethereum PPA" become: yes become_flags: "-H -S" apt_repository: repo: 'ppa:ethereum/ethereum' state: present - name: "Install System Dependencies" become: yes become_flags: "-H -S" apt: name: "{{ packages }}" update_cache: yes vars: packages: - python-pip - python3 - python3-pip - python3-dev - python3-setuptools - libffi-dev - software-properties-common - ethereum - name: "Generate Bootnode Keys" become: yes become_flags: "-H -S" shell: bootnode --genkey /home/ubuntu/bootnode.key --verbosity 6 - name: "Register Geth Bootnode Service" become: yes become_flags: "-H -S" template: src: ../../services/geth_bootnode.j2 dest: /etc/systemd/system/geth_botnode.service mode: 0755 - name: "Register Bootnode Public Key" become: yes become_flags: "-H -S" shell: bootnode --nodekey /home/ubuntu/bootnode.key --writeaddress register: bootnode_public_key - name: "Locally Save Bootnode Metadata" local_action: module: lineinfile dest: ./files/bootnodes.txt create: yes line: enode://{{ bootnode_public_key.stdout }}@{{inventory_hostname}}:{{ bootnode_port }} vars: bootnode_port: "30301" - name: "Render Geth Bootnode Service" become: yes become_flags: "-H -S" template: src: ../../services/geth_bootnode.j2 dest: /etc/systemd/system/geth_bootnode.service mode: 0755 - name: "Enable and Start Geth Bootnode Service" become: yes become_flags: "-H -S" systemd: daemon_reload: yes no_block: yes enabled: yes state: restarted name: "geth_bootnode"