Skip to content

Commit

Permalink
fix: don't hardcode Agoric parameters within Ansible scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 23, 2020
1 parent f2141b6 commit 19d0e13
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/deployment/ansible/cosmos-genesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- NETWORK_CONFIG_URL: https://testnet.agoric.com/network-config
- STAKER: ag-staker
- STAKER_TOKENS: 10000000000000000000000000uagstake
- STAKER_IDENTITY_FLAGS: "--website=https://testnet.agoric.com --identity=https://keybase.io/team/agoric.testnet.validators"
- STAKER_AMOUNT: 50000000uagstake
- STAKER_NODE: node0
roles:
Expand Down
1 change: 0 additions & 1 deletion packages/deployment/ansible/cosmos-validators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- CHAIN_NAME: "{{ lookup('file', SETUP_HOME + '/' + service + '/chain-name.txt') }}"
- STAKER: ag-staker
- STAKER_NODE: node0
- STAKER_IDENTITY_FLAGS: "--website=https://testnet.agoric.com --identity=https://keybase.io/team/agoric.testnet.validators"
- STAKER_AMOUNT: 50000000uagstake
roles:
- cosmos-validators
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
become_user: "{{ service }}"
shell: "\
{{ service }} gentx --keyring-backend=test --amount={{ STAKER_AMOUNT }} \
{{ STAKER_IDENTITY_FLAGS }}
{{ (website | default(None)) and '--website=' ~ website }} \
{{ (identity | default(None)) and '--identity=' ~ identity }} \
--name={{ STAKER }}-{{ STAKER_NODE }} --output-document={{ json }}"
vars:
json: "/home/{{ service }}/.{{ service }}/config/gentx/{{ STAKER_NODE }}.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
shell: "\
ag-cosmos-helper tx staking create-validator --keyring-backend=test \
--chain-id={{ CHAIN_NAME }} --amount={{ STAKER_AMOUNT }} \
--moniker={{ inventory_hostname }} --pubkey={{ valconspub }} \
{{ STAKER_IDENTITY_FLAGS }}
--moniker={{ moniker | default(inventory_hostname) }} --pubkey={{ valconspub }} \
{{ (website | default(None)) and '--website=' ~ website }} \
{{ (identity | default(None)) and '--identity=' ~ identity }} \
--commission-rate=0.1 --commission-max-rate=0.2 --commission-max-change-rate=0.01 \
--min-self-delegation=1 --broadcast-mode=block --from={{ staker }} --yes"
vars:
Expand Down
3 changes: 2 additions & 1 deletion packages/deployment/ansible/roles/init-cosmos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
- name: "Initialize {{ service }}"
become: yes
become_user: "{{ service }}"
shell: "{{ service }} init --overwrite {{ inventory_hostname }} --chain-id={{ CHAIN_NAME }}"
shell: "{{ service }} init {{ moniker | default(inventory_hostname) }} \
--overwrite --chain-id={{ CHAIN_NAME }}"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
regexp: '^addr_book_strict *='
line: 'addr_book_strict = false'

- name: Set index_all_keys=true
lineinfile:
path: "/home/{{ service }}/.{{ service }}/config/config.toml"
state: present
regexp: '^index_all_keys *='
line: 'index_all_keys = true'

- name: "check if prometheus-tendermint.txt exists"
delegate_to: localhost
stat:
Expand Down

0 comments on commit 19d0e13

Please sign in to comment.