0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AL2023にyarnをansibleを使ってインストールしたい

Posted at

こちらを参考に手順を作りました

手順をplaybookに変換しているだけですが、こちらでうまく動作いたしました。

playbook.yaml
- name: yarn をインストールする手順
  block:

  - name: node をインストール
    ansible.builtin.shell:
      cmd: "curl --silent --location https://rpm.nodesource.com/setup_20.x | sudo bash -"
    become: yes

  - name: yarn のrpmパッケージをダウンロード
    ansible.builtin.get_url:
      url: https://dl.yarnpkg.com/rpm/yarn.repo
      dest: /etc/yum.repos.d/yarn.repo
      mode: '0755'
    become: yes
  
  - name: yarn をインストール
    ansible.builtin.dnf:
      name: yarn
      state: present
  become: yes

コマンド
ansible-playbook playbook.yml --ask-become-pass

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?