Skip to content

Commit aaff66b

Browse files
yarn-22-04
1 parent 8d89423 commit aaff66b

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

yarn-22-04/yarn.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
mkdir -p {/usr/local/src/yarn-22-04/opt/cloudstack/,/usr/local/src/yarn-22-04/}
4+
5+
cd /usr/local/src/yarn-22-04/opt/cloudstack/ && wget https://raw.githubusercontent.com/stackbill/marketplace/main/_common-files/opt/cloudstack/cleanup.sh
6+
7+
cd /usr/local/src/yarn-22-04/ && wget https://raw.githubusercontent.com/stackbill/marketplace/main/yarn-22-04/yarn.yaml

yarn-22-04/yarn.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
- name: Yarn Setup
2+
hosts: localhost
3+
tasks:
4+
- name: Restarting sshd
5+
shell: "sed -i 's/#Match User anoncvs/ForceCommand echo Please wait until the installation is completed..../g' /etc/ssh/sshd_config && systemctl restart sshd"
6+
7+
- name: Updating Packages
8+
ansible.builtin.apt:
9+
update_cache: yes
10+
11+
- name: Configuring Repo for Nodejs
12+
shell: "{{ item }}"
13+
with_items:
14+
- wget -qO- https://deb.nodesource.com/setup_18.x | sudo -E bash
15+
16+
- name: Installing Nodejs
17+
apt:
18+
name: nodejs
19+
state: present
20+
21+
- name: Installing Yarn using corepack
22+
shell: "{{ item }}"
23+
with_items:
24+
- corepack enable
25+
- corepack prepare [email protected] --activate
26+
27+
- name: Creating a directory for shell script
28+
ansible.builtin.file:
29+
path: /opt/cloudstack
30+
state: directory
31+
32+
- name: Copy files for shell script
33+
copy:
34+
src: "{{ item.confsrc }}"
35+
dest: "{{ item.confdest }}"
36+
with_items:
37+
- { confsrc: '/usr/local/src/yarn-22-04/opt/cloudstack/cleanup.sh', confdest: '/opt/cloudstack/'}
38+
39+
- name: Adding a line for shell script
40+
lineinfile:
41+
path: /root/.bashrc
42+
line: "chmod +x /opt/cloudstack/cleanup.sh && /opt/cloudstack/cleanup.sh"
43+
state: present
44+
45+
- name: Restarting sshd
46+
shell: "sed -i 's/ForceCommand echo Please wait until the installation is completed..../#Match User anoncvs/g' /etc/ssh/sshd_config && systemctl restart sshd"

0 commit comments

Comments
 (0)