aws-s3-backup/tasks/main.yaml
changeset 2 2556522a2a45
parent 0 df042396074e
child 7 dc3fca0131a7
equal deleted inserted replaced
1:fd351734f007 2:2556522a2a45
       
     1 ---
       
     2 
       
     3 - name: apt install pip
       
     4   become: yes
       
     5   apt: name="python-pip"
       
     6 
       
     7 - name: pip install aws cli packages
       
     8   become: yes
       
     9   pip: name="{{aws_s3_backup_pip_packages}}"
       
    10 
       
    11 - name: create aws config dir for root
       
    12   become: yes
       
    13   file: path="/root/.aws/" state="directory" mode="0755"
       
    14 
       
    15 - name: configure aws credentials for root
       
    16   become: yes
       
    17   template: src="aws-{{item}}.j2" dest="/root/.aws/{{item}}" mode="0600"
       
    18   with_items:
       
    19     - "credentials"
       
    20     - "config"
       
    21 
       
    22 - name: create systemd target
       
    23   become: yes
       
    24   copy:
       
    25     src: "aws-s3-backup.target"
       
    26     dest: "/lib/systemd/system/aws-s3-backup.target"
       
    27   notify: reload target
       
    28 
       
    29 - name: create systemd timer
       
    30   become: yes
       
    31   copy:
       
    32     src: "aws-s3-backup.timer"
       
    33     dest: "/lib/systemd/system/aws-s3-backup.timer"
       
    34   notify: reload timer
       
    35 
       
    36 - name: ensure timer is started
       
    37   become: yes
       
    38   systemd: name="aws-s3-backup.timer" enabled="yes" state="started"