aboutsummaryrefslogblamecommitdiff
blob: 0fbcf9dea66fe3c393eb684b8bce1ddaca557fa2 (plain) (tree)



























                                                                     








                                 
                                                                                                          
- name: login to docker hub
  community.docker.docker_login:
    username: "{{ lookup('aws_ssm', '/jinwei-me/docker/username') }}"
    password: "{{ lookup('aws_ssm', '/jinwei-me/docker/token') }}"

- name: pull ledger Docker image
  community.docker.docker_image:
    name: "{{ bean_image }}:{{ bean_image_tag }}"
    source: pull

- name: Create directory
  file:
    path: "{{ bean_home }}"
    state: directory
    mode: '0755'

- name: render config file
  template:
    src: docker-compose.yaml.j2
    dest: "{{ bean_home }}/docker-compose.yaml"
    mode: 0644

- name: start ledger container using docker-compose
  community.docker.docker_compose:
    project_name: ledger
    project_src: "{{ bean_home }}"
  register: output

- name: setup cronjob for upgrade
  cron:
    cron_file: ledger_upgrade
    user: root
    state: present
    name: "ledger upgrade"
    minute: "0"
    hour: "*"
    day: "*"
    job: "cd {{ bean_home }} && /usr/local/bin/docker-compose pull && /usr/local/bin/docker-compose up -d"
Powered by cgit v1.2.3 (git 2.41.0)