在日常使用ansible playbook的过程中,我们有时候希望做一下补救性的操作,做一些判断, 例如: Default 1 2 3 4 5 6 7 8 9 10 11 tasks: - block: - debug: msg='i execute normally' - command: /bi ...
分类:
其他好文 时间:
2021-04-08 13:17:01
阅读次数:
0
# 拉取镜像docker pull mongo:4.0.22# 启动容器,挂载本地目录 docker run -itd --name mongo -p 27017:27017 -v $PWD/mongodb:/data/db mongo:4.0.22 ...
分类:
数据库 时间:
2021-04-07 11:29:54
阅读次数:
0
【注】本文译自:https://www.edureka.co/blog/ansible-tutorial/ 在阅读本文之前,你应该已经知道,Ansible 构成了 DevOps 认证的关键部分,它是用于配置管理、部署和编排的工具。 本教程的主要内容包括: 学习如何编写 Ansible 剧本 学习 A ...
分类:
其他好文 时间:
2021-04-07 11:20:11
阅读次数:
0
默认mongoDB 并没有用户限制,任何人都可以连接数据库 默认有 admin 、 config 、local、 test 四个数据库,show dbs 命令开始会显示前三个数据库,因为test 没有数据。 1、内置角色 ####1.1 当前数据库的角色 |角色| 能够执行的操作| | | | | ...
分类:
数据库 时间:
2021-04-02 13:14:47
阅读次数:
0
MongoDB是一个基于分布式 文件存储的NoSQL数据库,适合存储JSON风格文件的形式。 三元素:数据库、集合和文档。 文档:对应着关系数据库中的行,就是一个对象,由键值对构成,是json的扩展Bson形式,示例 {'name':'guojing','gender':'男'} 集合:类似于关系数 ...
分类:
数据库 时间:
2021-03-31 12:29:59
阅读次数:
0
批量更新某个字段 例1: db.getCollection('bond_sentiment_news').find({"source" : 2,"siteUrl" : "http://www.21jingji.com/"}).forEach( function(item){ db.getCollec ...
分类:
数据库 时间:
2021-03-31 12:11:19
阅读次数:
0
在剧本中设置循环信息 vim test04.yml hosts: all remote_user: root tasks: name: Add Users user: name={{ item.name }} groups={{ item.groups }} state=present with_i ...
分类:
其他好文 时间:
2021-03-31 11:52:29
阅读次数:
0
文档链接 https://docs.ansible.com/ansible/latest/reference_appendices/config.html 配置文件 [defaults] inventory = /etc/ansible/hosts sudo_user=root remote_por ...
分类:
其他好文 时间:
2021-03-30 13:37:18
阅读次数:
0
ansible-doc -l |wc -l 模块数量 ansible命令语法: ansible 主机信息(IP 主机组 all) -m (模块名)command -a "操作动作" 01 02 03 04 05 06 绿色 操作执行成功 没有对远程主机做任何改动 黄色 操作执行成功 对远程主机数据信 ...
分类:
其他好文 时间:
2021-03-29 11:39:21
阅读次数:
0
Find 关于 find find 是 MongoDB 中查询数据的基本指令,相当于 SQL 中的 SELECT。 find 返回的是游标(迭代器)。 find 示例: db.movies.find({"year": 1975}) // 单条件查询 db.movies.find({"year": 1 ...
分类:
其他好文 时间:
2021-03-26 15:23:59
阅读次数:
0