- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我以前没有使用过 Ansible,有谁知道如何编写一个简单的 playbook 来卸载 nano 并在 Linux 服务器上安装 vim?我想在完成上述操作后,您需要包含一个选项来配置您想要的文本编辑器首选项。
干杯
编辑
这就是我到目前为止所得到的......
---
# Playbook to uninstall nano and install vim
- hosts: all
remote_user: luca
sudo: yes
tasks:
- name: uninstall nano
action: command: sudo apt-get purge nano
- name: Install vim
action: command: sudo apt-get install vim
最佳答案
tmp.yml
---
- hosts: all
tasks:
- name: nano remove
apt: name=nano state=absent
- name: vim install
apt: name=vim state=present
ansible-playbook tmp.yml
关于linux - Ansible 剧本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23048985/
我刚刚开始学习 Ansible 并且有一个关于什么定义“游戏”的问题。如果我在看一座寺庙,我的理解是戏剧通常从以下开始: - name: xxx hosts: yyy 我读过 姓名 : 关键字
我正在尝试从 Ansible 2.3.1.0 运行剧本。我的远程计算机是 RHEL7,Python 安装在/usr/bin/python 中。 我的剧本如下所示: --- - hosts: my-te
我正在使用主机文件在主机列表上运行一个 ansible 剧本: [consul] ${HOST1} ansible_ssh_host=${HOST1} ansible_ssh_user=devops
我以前没有使用过 Ansible,有谁知道如何编写一个简单的 playbook 来卸载 nano 并在 Linux 服务器上安装 vim?我想在完成上述操作后,您需要包含一个选项来配置您想要的文本编辑
我有一个包含多个主机的系统以确保可用性。我只需要在一台主机上运行我的 Ansible 剧本。但是,其中一些主机可能无法访问。假设我有 host1、host2、host3 ... 如果无法访问 host
我不断收到用户错误:(play)在剧本中。 Ansible 似乎在提示结肠,但我尝试的任何方法都不起作用。 - hosts: all become: root tasks: -name:
可能之前已经有人问过这个问题,但目前还找不到任何有用的东西。 我有这个任务: - name: Create folder if not exists win_file: path:
我想知道是否有人找到了一种解决方案,可以在库存组未定义或为空时避免显示任何警告。 我只想让剧本的一部分运行如果组存在并且不为空,如果不存在,跳过而不警告。 请阅读https://github.com/
我想知道是否有人找到了一种解决方案,可以在库存组未定义或为空时避免显示任何警告。 我只想让剧本的一部分运行如果组存在并且不为空,如果不存在,跳过而不警告。 请阅读https://github.com/
我有一个 python 应用程序调用下面的代码,计划通过 Ansible API 以编程方式运行 Ansible 剧本,而不是使用子进程之类的东西。 下面的代码运行但实际上似乎没有执行任何内容。抓取结
目前我的剧本结构是这样的: ~/test_ansible_roles ❯❯❯ tree . . ├── checkout_sources │ └── tasks │ └── main.
我有一个使用 Vagrant 创建并使用 Ansible 配置的 EC2 实例。 我有这个使用 apt 安装 2 个软件包的任务. --- - name: Install GIT & TIG ac
我对 SSH 服务器和 Ansible 很陌生,所以这可能是一个愚蠢的问题。 尝试运行 Ansible 剧本,同时使用下面的 bash 命令使用私钥访问服务器。 ansible-playbook db
我有一堆需要经常修补的服务器。我计划使用 Ansible 来协调修补过程。这里的要点是它必须是“全有或全无”修补。要么所有服务器都打补丁,要么没有。 我正在为我的剧本考虑的任务是这样的: 1 - 转到
当我表演时 ansible -i /home/linux/ansible/my-prereqs/hosts -m ping 'test' 172.16.57.101 | SUCCESS => {
我有以下剧本: - name: packagexx version check shell: apk version packagexx | awk 'NR>1{$1=$1;print}'
我想使用公共(public) aws key 对 .pem 文件来运行 ansible 剧本。我想在不更改我的 ~/.ssh/id_rsa.pub 的情况下执行此操作我无法从当前的 ~/.ssh/id
我正在尝试运行一个相对简单的 Ansible 剧本来通过 Vagrant 配置 Ubuntu 虚拟机。大致分为 3 个步骤: 更新并安装必要的软件包 将 rbenv 安装到指定用户的家中 通过rben
我是 ansible(和 docker)的新手。我想在任何暂存/生产服务器上使用我的 ansible playbook 之前对其进行测试。 由于我无法访问空的远程服务器,我认为最简单的测试方法是使用
通过 fork 变量,我可以告诉 ansible 应该并行执行多少台主机。当之前的所有主机完成时,将执行下一个主机。如果主机上的执行时间不同,我必须等待最后一台主机完成。 是否可以告诉 ansible
我是一名优秀的程序员,十分优秀!