我想帮助创建一个新的数据 struct ,它比较了这两本词典,
然后用词典创建一个列表.其 idea 是,在发生变化的情况下,保留旧版本并添加修改后的用户名/密码.
目标:
list: [{"username": "a1", "password": "apass1"}, {"username": "a2", "password": "apass2"}, {"username": "b1", "password": "bpass1"}, {"username": "c1", "password": "cpass1"}, {"c_username": "c1", "c_password" : "cpass1"} , {"c_username": "c2", "c2_password" : "cpass1"}]
---
name: "Username/Password version 1"
set_fact:
dict1: {"a_username": "a1", "a_password" : "apass1", "b_username": "b1", "b_password" : "bpass1", "c_username": "c1", "c_password" : "cpass1"}
name: "Username/Password version 2"
set_fact:
dict2: {"a_username": "a2", "a_password" : "apass2", "b_username": "b1", "b_password" : "bpass1", "c_username": "c2", "c2_password" : "cpass1"}
我希望这对管理我的PostgreSQL数据库中的服务中断很有用. 我还从保管库检索用户名/密码数据