我是这样在Bash脚本中安装Certbot的:
apt-get update -y && add-apt-repository ppa:certbot/certbot -y && apt-get update -y
apt-get upgrade nginx python-certbot-nginx -y
这就是我发现在默认的conf中安装Nginx的剧本语法:
- hosts: localhost
connection: local
become: true
tasks:
- name: install nginx
apt: pkg=nginx state=installed update_cache=true
是否也没有安装Certbot的不可执行的任务,而是上面的“更重”Bash代码?
发布于 2018-01-26 23:26:26
以下是bash安装脚本的直接不可转换:
- apt_repository:
repo: 'ppa:certbot/certbot'
- apt:
name: "{{ item }}"
update_cache: yes
with_items:
- nginx
- python-certbox-nginx
发布于 2018-01-23 09:58:25
对于Ubuntu 16.04应该是这样的
tasks
- name: Install Certbot.
package: "name=letsencrypt state=present"
或者您可以使用Github:https://github.com/geerlingguy/ansible-role-certbot中的一个角色。
发布于 2019-01-08 13:27:24
我就是这样做的:
- name: Add certbot repository
apt_repository:
repo: 'ppa:certbot/certbot'
- name: Install Certbot's Apache package
apt:
name: python-certbot-apache
state: present
https://devops.stackexchange.com/questions/3155
复制相似问题