many fixes

This commit is contained in:
vvzvlad 2024-09-18 01:18:25 +03:00
parent c0fd0330af
commit eaceb3ecfa

View File

@ -61,9 +61,15 @@
mode: '0644' mode: '0644'
- name: Set hostname - name: Set hostname
ansible.builtin.shell: | ansible.builtin.hostname:
hostnamectl set-hostname {{ serverid }} name: "{{ serverid }}"
echo "127.0.1.1 {{ serverid }}" >> /etc/hosts
- name: Ensure hostname is in /etc/hosts
ansible.builtin.lineinfile:
path: /etc/hosts
regexp: '^127\.0\.1\.1\s+'
line: "127.0.1.1 {{ serverid }}"
state: present
- name: Update and upgrade apt - name: Update and upgrade apt
ansible.builtin.apt: ansible.builtin.apt:
@ -71,9 +77,7 @@
upgrade: dist upgrade: dist
force_apt_get: true force_apt_get: true
register: apt_update_result register: apt_update_result
retries: 50 until: apt_update_result is success
delay: 50
until: apt_update_result is succeeded
- name: Install necessary packages - name: Install necessary packages
ansible.builtin.apt: ansible.builtin.apt:
@ -100,7 +104,6 @@
dest: /etc/docker/daemon.json dest: /etc/docker/daemon.json
content: | content: |
{ "log-driver": "journald" } { "log-driver": "journald" }
marker: ""
- name: Restart Docker - name: Restart Docker
ansible.builtin.service: ansible.builtin.service:
@ -113,11 +116,11 @@
- name: Update journald log SystemMaxUse=2G configuration - name: Update journald log SystemMaxUse=2G configuration
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/systemd/journald.conf path: /etc/systemd/journald.conf
regexp: '^SystemMaxUse='
line: 'SystemMaxUse=2G' line: 'SystemMaxUse=2G'
insertafter: EOF state: present
create: true backup: yes
marker: "" validate: 'journaldctl check-config %s'
mode: '0644'
- name: Restart journald - name: Restart journald
ansible.builtin.service: ansible.builtin.service:
@ -178,7 +181,7 @@
chdir: "{{ ansible_env.HOME }}/ritual" chdir: "{{ ansible_env.HOME }}/ritual"
retries: 2 retries: 2
delay: 60 delay: 60
failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_output.stdout' failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_deploy_output.stdout'
- name: Update CallContract.s.sol with contract address - name: Update CallContract.s.sol with contract address
ansible.builtin.shell: | ansible.builtin.shell: |
@ -190,12 +193,12 @@
- name: Call contract - name: Call contract
ansible.builtin.shell: project=hello-world make call-contract 2>&1 ansible.builtin.shell: project=hello-world make call-contract 2>&1
register: contract_output register: contract_call_output
args: args:
chdir: "{{ ansible_env.HOME }}/ritual" chdir: "{{ ansible_env.HOME }}/ritual"
retries: 2 retries: 2
delay: 60 delay: 60
failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_output.stdout' failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_call_output.stdout'
- name: Set Docker containers to restart unless stopped - name: Set Docker containers to restart unless stopped
ansible.builtin.shell: | ansible.builtin.shell: |