ansible

How to update the Ansible gcp_container_cluster module?

孤者浪人 提交于 2021-02-11 12:10:21
问题 I'm facing a bug which I reported while using the gcp_container_cluster module. According to a comment on this bug This module is no longer maintained in this repository, and now located at https://github.com/ansible-collections/google.cloud/ Although the resulting module is located at the above repo, Google programmatically generates their modules, and the repo that houses the code to generate the module lives at https://www.github.com/GoogleCloudPlatform/magic-modules Thus I tried ansible

kubesphere集群搭建(多节点)

独自空忆成欢 提交于 2021-02-11 08:31:24
kubesphere官网: https://kubesphere.io/docs/advanced-v2.0/zh-CN/introduction/intro/ 一、准备环境 1、准备服务器 master1 :192.168.37.11 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 200G ( data) + 200G(mnt) master2 :192.168.37.12 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 200G ( data) master3 :192.168.37.13 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 200G ( data) node1: 192.168.37.14 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 1T ( data) node2: 192.168.37.15 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 1T ( data) node3: 192.168.37.16 centos7.5 + 8cpu + 16G(内存) + 20G(/) + 1T ( data) node4: 192.168.37.17 centos7.5 + 8cpu + 16G(内存) + 20G(/) +

How to omit if variable is empty in Ansibe?

喜欢而已 提交于 2021-02-11 06:22:23
问题 I'm going through ansible example for Docker. And I need to publish a port just like in the example but with an if statement if port else omit . Like this: docker_container: name: myapplication ... ports: - "{{ if port else omit }}" # the {{ port }} variable is set from the default task. ... But each time I run this, the Docker daemon tells me: template error while templating string: expected token 'end of print statement', got 'port'. String: {{ if port else omit }}" How do I omit setting

How to omit if variable is empty in Ansibe?

删除回忆录丶 提交于 2021-02-11 06:21:52
问题 I'm going through ansible example for Docker. And I need to publish a port just like in the example but with an if statement if port else omit . Like this: docker_container: name: myapplication ... ports: - "{{ if port else omit }}" # the {{ port }} variable is set from the default task. ... But each time I run this, the Docker daemon tells me: template error while templating string: expected token 'end of print statement', got 'port'. String: {{ if port else omit }}" How do I omit setting

Replace value in list of dict in Ansible

假装没事ソ 提交于 2021-02-11 04:36:32
问题 I'm trying to replace the value of the key "extension_last_heartbeat_time" (date) with a static string "<LAST_HEARTBEAT_TIME>" in this list of dicts [ { "vcenter": "vcenter-A", "vcenter_extension_info": [ { "extension_company": "VMware Inc.", "extension_key": "com.vmware.vim.sms", "extension_label": "VMware vCenter Storage Monitoring Service", "extension_last_heartbeat_time": "2020-11-03T09:05:41.676497+00:00", "extension_type": "", "extension_version": "5.5" }, { "extension_company": "VMware

Replace value in list of dict in Ansible

只谈情不闲聊 提交于 2021-02-11 04:35:47
问题 I'm trying to replace the value of the key "extension_last_heartbeat_time" (date) with a static string "<LAST_HEARTBEAT_TIME>" in this list of dicts [ { "vcenter": "vcenter-A", "vcenter_extension_info": [ { "extension_company": "VMware Inc.", "extension_key": "com.vmware.vim.sms", "extension_label": "VMware vCenter Storage Monitoring Service", "extension_last_heartbeat_time": "2020-11-03T09:05:41.676497+00:00", "extension_type": "", "extension_version": "5.5" }, { "extension_company": "VMware

Replace value in list of dict in Ansible

喜欢而已 提交于 2021-02-11 04:33:16
问题 I'm trying to replace the value of the key "extension_last_heartbeat_time" (date) with a static string "<LAST_HEARTBEAT_TIME>" in this list of dicts [ { "vcenter": "vcenter-A", "vcenter_extension_info": [ { "extension_company": "VMware Inc.", "extension_key": "com.vmware.vim.sms", "extension_label": "VMware vCenter Storage Monitoring Service", "extension_last_heartbeat_time": "2020-11-03T09:05:41.676497+00:00", "extension_type": "", "extension_version": "5.5" }, { "extension_company": "VMware

Ansible, How to modify a variable during a loop?

让人想犯罪 __ 提交于 2021-02-10 19:38:23
问题 I am using Ansible 2.3.0.0 and I have tested in Ansible 2.4.0.0, obtaining the same result. My problem is simple. I have the following list: vars: password_text_to_encrypt: - { line: "{{truststore_pass }}" , result: } - { line: "{{ keystore_pass }}" , result: } - { line: "{{ gp_pass }}" , result: } - { line: "{{ datasource_password }}" , result: } - { line: "{{ server_password }}" , result: } - { line: "{{ sftp_password }}" , result: } - { line: "{{ db_userpassword }}" , result: } roles: -

How to get postgresql_query results from Ansible

半腔热情 提交于 2021-02-10 18:37:17
问题 I'm trying to print the output of PostgreSQL query that is run by Ansible. Unfortunately I'm not sure how to get ahold of the return value. - name: Get specific tables postgresql_query: db: "{{ database_name }}" login_host: "{{ my_host }}" login_user: "{{ my_user }}" login_password: "{{ my_password }}" query: SELECT * FROM pg_tables t WHERE t.tableowner = current_user Googling just says to use register: , but the PostgreSQL ansible module does not have a register param: fatal: [xx.xxx.xx.xx]:

Ansible: How to create empty inventory group in playbook?

你。 提交于 2021-02-10 14:59:43
问题 I use some roles with playbooks which setting up a dozen services across a cluster and use inventory groups to specify hosts for roles. According to the environment I need to extract an inventory from ENV in playbook. In the common case most of the services aren't necessary, so there is no hosts to add to a corresponding group, but a group must exist. In case of a static inventory it's pretty easy. But how to define an empty group in a playbook? 回答1: I couldn't find how to create an empty