ansible-inventory

    0熱度

    1回答

    使用個人用戶帳戶(userx),我在所有指定的主機上運行完整的操作手冊。在ansible.cfg要使用的遠程用戶(其可以成爲根)爲: remote_user = ansible 對於遠程主機這一切工作正常。它以用戶Ansible的身份連接,並執行所有需要的任務,同時也改變需要root權限的信息(如/etc/ssh/sshd_config)。 但是現在我也想在Ansible主機本身上執行劇本。我

    0熱度

    1回答

    我正在爲自己開發一個小型項目。 我在我的角色的默認文件夾中有一個main.yml。 結構: master-folder `- roles `- some_role |- tasks | `- main.yml `- defaults `- main.yml 現在... 在我some_variables.yml我有2個瓦爾字典。 pa

    0熱度

    1回答

    下面是基本用例: 我有一個NGINX反向代理我想成立,所以我具體的,只有在運行的遊戲「nginx」組。 但是,爲了知道ips來反向代理,我需要從「上游」組收集事實。這不會發生,因爲該遊戲在「上游」上未運行setup。 This answer包含我之前使用過的解決方案,但我希望能夠將它全部包含在單個主機遊戲中,我可以獨立運行其他遊戲。

    0熱度

    1回答

    調用多個角色需要幫助以查看此include_role的錯誤。 這項工作沒有任何問題: #US East (N. Virginia) - hosts: localhost gather_facts: false connection: local vars: region_services: - "us-east-1" tasks:

    1熱度

    1回答

    我有一個主機文件看起來大致是這樣的: [kibanamaster] efk host_ip host user passwd [elasticnode] esnode host_ip user passwd ,我在 - name: get ip address node1 debug: var=hostvars[inventory_host]['esnode']['ansibl

    0熱度

    1回答

    我Ansible hosts文件: mybox.mydomain.com ansible_ssh_pass={{mypassword}} 變量 '輸入mypassword' 在一個文件中 「variables.yml」 定義: mypassword = somepassword 有沒有一種方法,我可以包括「變量的變量。 yml「在我的hosts文件中?否則,當我嘗試運行一些命令Ansibl

    0熱度

    1回答

    我有我的Ansible項目結構是這樣的: 我appServershosts下包含了我的主機如下: local ansible_ssh_host=127.0.0.1 staging ansible_ssh_host=<host_ip> ansible_connection=ssh ansible_user=ubuntu ansible_ssh_private_key_file=<key> v

    0熱度

    1回答

    運行後,下面的Ansible YAML文件中的輸出顯示文件被創建和內容發生變化 的YAML文件 --- - hosts: all gather_facts: yes connection: local tasks: - name: Check the date on the server. action: command touch /opt/

    1熱度

    2回答

    我想運行一個劇本,其中包含我使用group_by模塊動態創建的多個主機組上的某些角色。 我能夠像下面的例子那樣做(ping替換我的實際角色)。 我想知道是否有辦法在循環中分別運行每個組,而不是列出所有實例ID。我不想爲每個實例ID創建一個重複行。 這裏的目的是一次部署到每個數據中心的一個實例,而不是使用需要很長時間的低串行運行。 可能有不同的做法,我不想在庫存中爲每個instance_id也創建靜

    0熱度

    1回答

    我的劇本(/home/user/Ansible/dist/playbooks/test.yml): - hosts: regional_clients tasks: - shell: /export/home/user/ansible_scripts/test.sh register: shellout - debug: var=shellout - h