ansible - 使用 ansible playbook 在 ubuntu 20.04 上安装 ngnix?
问题描述
嗨,我是 ansible 的新手,我必须将最新的 nodejs12.8.4、SSL 和 ngnix 部署到 Ubuntu 20.04 服务器上,有人可以指导我如何操作,谢谢。
这是我的 yml 文件:
hosts: all
become: true
tasks:
- name: install nodejs prerequisites
apt:
name:
- apt-transport-https
- gcc
- g++
- make
state: present
- name: add nodejs apt key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
- name: add nodejs repository
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x {{ ansible_lsb.codename }} main
state: present
update_cache: yes
- name: install nodejs
apt:
name: nodejs
state: present
它安装 nodejs 12 现在我想在同一个文件中安装 nginx 如何添加新任务。
解决方案
推荐阅读
- powershell - Powershell - 如何在Firefox中选择并单击超链接
- node.js - Angular 客户端数据的存储位置,稍后在 REST-API 中用于获取信息
- php - 数组创建重复标签(wordpress)
- ajax - 甜蜜警报正在覆盖循环中的一个警报
- python - JSONDecodeError:期望值:使用 Translate API 的第 1 行第 1 列(字符 0)
- node.js - next 不是函数。Nodejs http://localhost:3000/api/authenticate
- python - 如何使用 Python Tkinter 实现这种类型的结果?
- node.js - 在猫鼬nodejs中测试排序api
- angular - number pipe number:'1.0-0' 是否对数字进行四舍五入?
- java - 在谷歌开发者控制台中上传应用签名 sha-1 后,我的身份验证不起作用