blob: 6530da96161ca576e089b33a40ecccc9d6101c13 [file] [log] [blame]
---
- hosts: '{{ hosts }}'
vars:
ansible_config: ~/.ansible
tasks:
- name: Install system packages
become: yes
yum:
name: '{{ item }}'
state: present
with_items:
- elasticache-auto-discovery
when: ansible_os_family | lower == 'redhat'
- name: Update .bashrc with aws_access_key
lineinfile:
backup: yes
dest: ~/.bashrc
state: present
line: 'export AWS_SECRET_ACCESS_KEY={{ aws_access_key }}'
when: aws_access_key is defined and update_env is defined and update_env
- name: Update .bashrc with aws_secret_key
lineinfile:
backup: yes
dest: ~/.bashrc
state: present
line: 'export AWS_ACCESS_KEY_ID={{ aws_secret_key }}'
when: aws_secret_key is defined and update_env is defined and update_env
- name: Update .bashrc with aws_region
lineinfile:
backup: yes
dest: ~/.bashrc
state: present
line: 'export AWS_REGION={{ aws_region }}'
when: aws_secret_key is defined and update_env is defined and update_env