updated how we update ec2 attributes
diff --git a/resources/boto.j2 b/resources/boto.j2 deleted file mode 100644 index 500b16f..0000000 --- a/resources/boto.j2 +++ /dev/null
@@ -1,4 +0,0 @@ -[Credentials] -aws_access_key_id = {{ aws_access_key }} -aws_secret_access_key = {{ aws_secret_key }} -ec2_region_name = {{ aws_region }}
diff --git a/setup-ec2.yml b/setup-ec2.yml index 714478d..6530da9 100644 --- a/setup-ec2.yml +++ b/setup-ec2.yml
@@ -14,33 +14,6 @@ - elasticache-auto-discovery when: ansible_os_family | lower == 'redhat' - - - name: Create a template .boto config file - template: - src: resources/boto.j2 - dest: ~/.boto - mode: 0644 - when: aws_access_key is defined and aws_secret_key is defined and aws_region is defined - - - name: Create a template ec2.ini config file - copy: - src: resources/ec2.ini - dest: '{{ ansible_config }}/ec2.ini' - mode: 0644 - - - name: Update EC2_INI_PATH - lineinfile: - backup: yes - dest: ~/.bashrc - state: present - line: 'export EC2_INI_PATH={{ ansible_config }}/ec2.ini' - when: aws_access_key is defined and aws_secret_key is defined and aws_region is defined - - - name: Copy ec2.py script - copy: - src: resources/ec2.py - dest: '{{ ansible_config }}/ec2.py' - - name: Update .bashrc with aws_access_key lineinfile: backup: yes @@ -57,3 +30,11 @@ 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 +