Skip to content

Commit 045bd7b

Browse files
committed
Updated tools.yaml file with apt installation for aws cli and dependencies like curl, unzip packages along with python boto3 library. Download & conversion of gpg key was modified using curl command.
1 parent 230a957 commit 045bd7b

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

01-jenkins-setup/ansible/roles/jenkins-agent/tasks/ssh.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
script: "{{ playbook_dir }}/scripts/get-ssh-pub.py {{ public_key_path }}"
44
args:
55
executable: /usr/bin/python3
6-
remote_src: yes
76
register: secret_value
87

98
- name: Print registered variable

01-jenkins-setup/ansible/roles/jenkins-agent/tasks/tools.yaml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,41 @@
99
name: python3-pip
1010
state: present
1111

12-
- name: Install boto3 using pip3
13-
become: true
14-
pip:
15-
name: boto3
12+
- name: Install boto3 using apt
13+
apt:
14+
name: python3-boto3
1615
state: present
16+
become: yes
1717

18-
- name: Install AWS CLI using pip
19-
become: true
20-
pip:
21-
name: awscli
22-
state: latest
23-
executable: pip3
18+
- name: Install dependencies
19+
apt:
20+
name:
21+
- curl
22+
- unzip
23+
state: present
24+
25+
- name: Download AWS CLI installation script
26+
shell: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"
27+
28+
- name: Unzip AWS CLI installation package
29+
unarchive:
30+
src: /tmp/awscliv2.zip
31+
dest: /tmp/
32+
remote_src: yes
33+
34+
- name: Install AWS CLI
35+
shell: sudo /tmp/aws/install
2436

2537
- name: Install Ansible
26-
pip:
38+
apt:
2739
name: ansible
2840
state: latest
2941

30-
- name: Add HashiCorp GPG key
31-
become: yes
32-
shell: "wget -qO- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg"
42+
- name: Download and convert HashiCorp GPG key in one step
43+
shell: |
44+
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
45+
args:
46+
creates: /usr/share/keyrings/hashicorp-archive-keyring.gpg
3347

3448
- name: Add HashiCorp APT repository
3549
become: yes

0 commit comments

Comments
 (0)