ansible

ansible playbook for Azure network security group - Error: missing required arguments

随声附和 提交于 2020-12-15 05:31:40
问题 Following YAML playbook for creating Azure Network Security Group DOES specify the priority arguments. But I still get the following error when running the playbook in Azure Cloud Shell . What may be the cause of the error and how can we fix it? Remark: I see a similar issue posted on GitHub here. Create_network_security_group.yaml : --- - hosts: localhost tasks: - azure_rm_securitygroup: resource_group: rg-cs-ansible name: nsg-cs-web rules: - name: 'allow_rdp' protocol: Tcp destination_port

Ansible readfile and concatenate a variable to each line

别来无恙 提交于 2020-12-15 05:29:58
问题 Hi I have a file with list of filenames .I want to read each line and add a variable {{version}} to the end and pass it to another task which will download the artifact . MY_File cat file/branches.txt mhr- mtr- tsr I want to get each line add {{version}} to it mhr-1.1-SNAPSHOT mtr-1.1-SNAPSHOT tsr-1.1-SNAPSHOT I couldn't get the file names and append them. below is a failed attempt by me . --- - name: get file names shell: echo {{item}}{{version}} register: result with_lines: cat files

Unable to change password for root account ansible

拜拜、爱过 提交于 2020-12-13 18:55:30
问题 I have the following error: {"failed": true, "invocation": {"module_args": {"append_privs": false, "check_implicit_admin": true, "config_file": "/root/.my.cnf", "connect_timeout": 30, "encrypted": false, "host": "rothko", "host_all": false, "login_host": "localhost", "login_password": "", "login_port": 3306, "login_unix_socket": null, "login_user": "root", "name": "root", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "priv": "*.*:ALL,GRANT", "sql_log_bin": true, "ssl_ca": null, "ssl_cert

Unable to change password for root account ansible

两盒软妹~` 提交于 2020-12-13 18:50:43
问题 I have the following error: {"failed": true, "invocation": {"module_args": {"append_privs": false, "check_implicit_admin": true, "config_file": "/root/.my.cnf", "connect_timeout": 30, "encrypted": false, "host": "rothko", "host_all": false, "login_host": "localhost", "login_password": "", "login_port": 3306, "login_unix_socket": null, "login_user": "root", "name": "root", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "priv": "*.*:ALL,GRANT", "sql_log_bin": true, "ssl_ca": null, "ssl_cert

Run powershell script from Ansible

偶尔善良 提交于 2020-12-13 07:35:40
问题 I have a powershell script which takes multiple user inputs for file ex.- "C:\temp\foo.ps1", then it runs. I am trying to integrate that script with Ansible using win_shell module. How can I pass the user inputs for the powershell script :- - name: windows test command win_shell: C:\temp\Snapshots.ps1 args: stdin: C:\temp\test3.csv Script(powershell):- $CONumber = Read-Host "Enter the CO Number" SO this takes input from user, how can I edit this using vars_prompt variable? 回答1: To pass the

Run powershell script from Ansible

故事扮演 提交于 2020-12-13 07:35:26
问题 I have a powershell script which takes multiple user inputs for file ex.- "C:\temp\foo.ps1", then it runs. I am trying to integrate that script with Ansible using win_shell module. How can I pass the user inputs for the powershell script :- - name: windows test command win_shell: C:\temp\Snapshots.ps1 args: stdin: C:\temp\test3.csv Script(powershell):- $CONumber = Read-Host "Enter the CO Number" SO this takes input from user, how can I edit this using vars_prompt variable? 回答1: To pass the

一文读懂DevOps

梦想与她 提交于 2020-12-12 21:41:30
抽象的 DevOps “ DevOps 是使软件开发和 IT 团队之间的流程自动化的一组实践,以便他们可以更快,更可靠地构建,测试和发布软件。DevOps 的概念建立在建立团队之间协作文化的基础上,这些团队过去一直在相对孤岛中运作。” 类似于这种的 DevOps 相关的描述听起来特别抽象,非常学术,非常教科书,让人感觉无法落地,不知道该如何入手。很多团队在了解 DevOps,实践 DevOps 的时候不能很好的多维度看待 DevOps,实践的过程也很痛苦,不知道这种新型的理念如何实际提升自己团队的战斗力。 本文从开发和运维两个视角多层次的讲解什么场景应该 Dev 和 Ops、什么场景应该 DevOps,即 DevOps 的分与合,并使用一个 Demo 示例告诉大家 DevOps 中的关键步骤持续部署如何实践。 DevOps 的两个视角 DevOps 从字面上看就是开发和运维,也有翻译为开发运维(运营)一体化。我们这里的两个视角不是别的东西,正是开发和运维。这里的开发,不能简单的理解为开发工程师,指代的是整个软件的研发过程所含的所有要素,涵盖需求分析、开发、测试等等,其终点是可交付的软件制品。同样运维不仅仅是运维工程师,指代的是软件交付后投产过程以及后续的运营,反馈等系列过程,其起点是接受交付的软件制品。 这么两个视角的区分是隐含着软件工程背后的逻辑的,就像一栋大楼

CentOS 安装 MySQL

六眼飞鱼酱① 提交于 2020-12-12 10:39:49
MySQL 安装 通过 Yum Repository 方式安装 注意点:CentOS7 默认安装了 mariadb 数据库,先移除: yum remove mariadb-libs 添加 MySQL Yum源 简要概况,它是通过安装 mysql80-community-release-el7-2.noarch.rpm 包来实现配置 Yum 源的,这个 rpm 包并非 MySQL 的真正安装包。 你可以通过下载两个途径下载这个 mysql80-community-release-el7-2.noarch.rpm 包: wget https://repo.mysql.com//mysql80-community-release-el7-2.noarch.rpm 下载下来; MySQL Yum Repository page 手动下载,再上传到服务器上; 下载下来之后,执行: yum localinstall mysql80-community-release-el7-2.noarch.rpm 可以通过以下命令检查MySQL Yum源是否已成功添加: yum repolist enabled | grep "mysql.*-community.*" 上面步骤执行完之后,会在 /etc/yum.repos.d/ 目录下生成 MySQL 相关的 Yum 源配置,需要对这个配置文件进行一些设置

JMESPath expression to flatten array of objects, each with nested arrays of objects

拟墨画扇 提交于 2020-12-10 09:31:56
问题 I have JSON containing an array of databases, each database has an array of users, e.g. {"databases": [ {"db": "db_a", "users": [{"name": "alice"}, {"name": "alex"}]}, {"db": "db_b", "users": [{"name": "bob"}, {"name": "brienne"}]} ]} I would like to produce a flat array of databases and users, i.e. [ {"db": "db_a", "name": "alice"}, {"db": "db_a", "name": "alex"}, {"db": "db_b", "name": "bob"}, {"db": "db_b", "name": "brienne"} ] In SQL terms this would be a cartesian join or cartesian

JMESPath expression to flatten array of objects, each with nested arrays of objects

折月煮酒 提交于 2020-12-10 09:28:49
问题 I have JSON containing an array of databases, each database has an array of users, e.g. {"databases": [ {"db": "db_a", "users": [{"name": "alice"}, {"name": "alex"}]}, {"db": "db_b", "users": [{"name": "bob"}, {"name": "brienne"}]} ]} I would like to produce a flat array of databases and users, i.e. [ {"db": "db_a", "name": "alice"}, {"db": "db_a", "name": "alex"}, {"db": "db_b", "name": "bob"}, {"db": "db_b", "name": "brienne"} ] In SQL terms this would be a cartesian join or cartesian