我正在尝试使用Ansible安装Sublime Text(在Ubuntu上) . 这是我试图用来完成这个的基本Ansible剧本,基于:
-
bash命令here安装Sublime Text
-
Ansible docs apt-repository和apt-key
---
- hosts: all
vars:
- my_repos:
- ppa: https://download.sublimetext.com/
- ppa: [arch=amd64] http://dl.google.com/linux/chrome/deb/
- my_pkgs:
- sublime-text
- google-chrome-stable
tasks:
- Install GPG key
name: install GPG key for SubLimeText
???????
- name: Add specified repositories into sources list using specified filename
apt_repository: repo=deb {{ item }} stable main
state=present
filename='{{ item }}'
with_items:
- my_repos
- name: Install packages
apt: state=installed pkg={{ item }}
with_items:
- my_pkgs
第一个任务是为SublimeText安装GPG密钥(按照上面的第一个链接) . 我阅读了Ansible docs here,但我不知道如何将其转换为SublimeText案例 .
Questions:
- 在SublimeText指令中,步骤1:指定了指向GPG密钥的直接链接 . 他们说:
Install the GPG key: https://download.sublimetext.com/sublimehq-pub.gpg
但是如何使用Ansible apt_key
模块添加它?
- 在步骤2中:使用
apt_repository
的任务是否对应于bash命令echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
1 回答