repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable state: present filename: docker - name: Install Docker 23.0.1-1 ansible.builtin.apt: name: - docker-ce=5:23.0.1-1~ubuntu.22.04~jammy -docker-ce-cli=5:23.0.1-1~ubuntu.22.04~jammy -...
curl -Lhttps://get.daocloud.io/docker/compose/releases/download/2.27.1/docker-compose-uname -s-uname -m> /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose name: Create symlink for Docker Compose ansible.builtin.file: src: /usr/local/bin/docker-compose dest: /usr/bin...
shell:sudosystemctl daemon-reload &&sudosystemctl restart docker tags: restart mirror配置 [root@localhost ~]#catdocker-daemon.json {"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn"] } 4.运行playbook ansible-playbook...
3.编写playbook --- - hosts: docker remote_user: root tasks: - name: install yum-utils yum: name=yum-utils state=present - name: add docker repo shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo - name: install docer-ce yum: name: docker-...
Playbook使用场景 执行一些简单的任务,使用ad-hoc(调用各种模块,通过命令行来执行命令)命令可以方便的解决问题,但是有时一个设施过于复杂,需要大量的操作时候,执行的ad-hoc命令是不适合的,这时最好使用playbook,就像执行shell命令与写shell脚本一样,也可以理解为批处理任务,不过playbook有自己的语法格式。
下面是一个基本的Ansible Playbook,用于在目标主机上安装Docker: 代码语言:javascript 复制 ---name:Install Dockerhosts:target_hostbecome:truetasks:-name:Install required packagesapt:name:"{{ packages }}"state:presentvars:packages:-apt-transport-https-ca-certificates-curl-gnupg-lsb-release-name:Add Docke...
本次介绍ansible的paly book结合docker进行虚拟机里安装2.6.8版本smokeping(apache版本是2.4.7)。 docker版本 09:26:53 # docker version Client version: 0.11.1 Client API version: 1.11 Go version (client): go1.2.1 Git commit (client): fb99f99/0.11.1 Server version: 0.11.1...
运维自动化之ansible playbook结合docker安装smokeping 本次介绍ansible的paly book结合docker进行虚拟机里安装2.6.8版本smokeping(apache版本是2.4.7)。 docker版本 1 2 3 4 5 6 7 8 9 10 09:26:53# docker version Client version: 0.11.1 Client API version: 1.11...
docker版本 09:49:09 # docker version Client version: 0.11.1 Client API version: 1.11 Go version (client): go1.2.1 Git commit (client): fb99f99/0.11.1 Server version: 0.11.1 Server API version: 1.11 Git commit (server): fb99f99/0.11.1 ...
09:49:09 # docker version Client version: 0.11.1 ClientAPIversion: 1.11 Go version (client): go1.2.1 Gitcommit (client): fb99f99/0.11.1 Server version: 0.11.1 Server API version: 1.11 Git commit (server): fb99f99/0.11.1 Go version (server): go1.2.1 ...