-
Notifications
You must be signed in to change notification settings - Fork 0
/
Amazon.yml
59 lines (52 loc) · 1.42 KB
/
Amazon.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- name: Get OS
debug:
var: ansible_distribution
- name: Ensure OS is compatible
assert:
that:
ansible_distribution == "Amazon"
fail_msg: OS must be Amazon Linux 2.
- name: Update repo
package:
name: '*'
state: latest
update_cache: true
- name: Add Azure-cli to yum repository
yum_repository:
name: azure-cli
description: Microsoft Azure CLI
baseurl: https://packages.microsoft.com/yumrepos/azure-cli
gpgkey: https://packages.microsoft.com/keys/microsoft.asc
gpgcheck: yes
enabled: yes
- name: Install developer packages (azure, git, python)
package:
name: zip, unzip, python3-pip, polkit
state: latest
vars:
ansible_python_interpreter: /usr/bin/python
- name: Install developer packages (boto)
pip:
name:
- chardet2
- urllib3
- requests # Python Requests module
- boto3 # AWS SDK
- boto # AWS SDK
- botocore # AWS SDK
- pywinrm # Windows Python manager module
- pyvmomi # VMWare SDK
state: latest
extra_args: --user
vars:
ansible_python_interpreter: /usr/bin/python3.8
- name: Get latest version of terraform
shell: curl https://www.terraform.io/downloads.html | grep -A1 'linux' | sed -n 's/.*href="\(.*\)".*/\1/p'
args:
warn: false
register: terraform
- name: Install developer packages (terraform)
unarchive:
src: "{{ terraform.stdout_lines[1] }}"
dest: /usr/local/bin/
remote_src: yes