久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='AHTOa'><style id='AHTOa'><dir id='AHTOa'><q id='AHTOa'></q></dir></style></legend>

    • <bdo id='AHTOa'></bdo><ul id='AHTOa'></ul>
  • <i id='AHTOa'><tr id='AHTOa'><dt id='AHTOa'><q id='AHTOa'><span id='AHTOa'><b id='AHTOa'><form id='AHTOa'><ins id='AHTOa'></ins><ul id='AHTOa'></ul><sub id='AHTOa'></sub></form><legend id='AHTOa'></legend><bdo id='AHTOa'><pre id='AHTOa'><center id='AHTOa'></center></pre></bdo></b><th id='AHTOa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AHTOa'><tfoot id='AHTOa'></tfoot><dl id='AHTOa'><fieldset id='AHTOa'></fieldset></dl></div>

      1. <tfoot id='AHTOa'></tfoot>

        <small id='AHTOa'></small><noframes id='AHTOa'>

        Ansible 冪等 MySQL 安裝 Playbook

        Ansible idempotent MySQL installation Playbook(Ansible 冪等 MySQL 安裝 Playbook)
        <i id='dGsXo'><tr id='dGsXo'><dt id='dGsXo'><q id='dGsXo'><span id='dGsXo'><b id='dGsXo'><form id='dGsXo'><ins id='dGsXo'></ins><ul id='dGsXo'></ul><sub id='dGsXo'></sub></form><legend id='dGsXo'></legend><bdo id='dGsXo'><pre id='dGsXo'><center id='dGsXo'></center></pre></bdo></b><th id='dGsXo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dGsXo'><tfoot id='dGsXo'></tfoot><dl id='dGsXo'><fieldset id='dGsXo'></fieldset></dl></div>

        <tfoot id='dGsXo'></tfoot>
        • <small id='dGsXo'></small><noframes id='dGsXo'>

        • <legend id='dGsXo'><style id='dGsXo'><dir id='dGsXo'><q id='dGsXo'></q></dir></style></legend>

                <tbody id='dGsXo'></tbody>
              • <bdo id='dGsXo'></bdo><ul id='dGsXo'></ul>

                  本文介紹了Ansible 冪等 MySQL 安裝 Playbook的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我想在 AWS 上設置一個 MySQL 服務器,使用 Ansible 進行配置管理.我使用的是 Amazon (ami-3275ee5b) 的默認 AMI,它使用 yum 進行包管理.

                  I want to setup a MySQL server on AWS, using Ansible for the configuration management. I am using the default AMI from Amazon (ami-3275ee5b), which uses yum for package management.

                  當執行下面的 Playbook 時,一切順利.但是當我第二次運行它時,任務 Configure the root credentials 失敗了,因為 MySQL 的舊密碼不再匹配,因為它已在我上次運行此 Playbook 時更新.

                  When the Playbook below is executed, all goes well. But when I run it for a second time, the task Configure the root credentials fails, because the old password of MySQL doesn't match anymore, since it has been updated the last time I ran this Playbook.

                  這使得 Playbook 非冪等,我不喜歡.我希望能夠根據需要多次運行 Playbook.

                  This makes the Playbook non-idempotent, which I don't like. I want to be able to run the Playbook as many times as I want.

                  - hosts: staging_mysql
                    user: ec2-user
                    sudo: yes
                  
                    tasks:
                      - name: Install MySQL
                        action: yum name=$item
                        with_items:
                          - MySQL-python
                          - mysql
                          - mysql-server
                  
                      - name: Start the MySQL service
                        action: service name=mysqld state=started
                  
                      - name: Configure the root credentials
                        action: command mysqladmin -u root -p $mysql_root_password
                  

                  解決這個問題的最佳方法是什么,這意味著使 Playbook 具有冪等性?提前致謝!

                  What would be the best way to solve this, which means make the Playbook idempotent? Thanks in advance!

                  推薦答案

                  用于安全安裝 MySQL 的 Ansible 版本.

                  mysql_secure_installation.yml

                  - hosts: staging_mysql
                    user: ec2-user
                    sudo: yes
                  
                    tasks:
                      - name: Install MySQL
                        action: yum name={{ item }}
                        with_items:
                          - MySQL-python
                          - mysql
                          - mysql-server
                  
                      - name: Start the MySQL service
                        action: service name=mysqld state=started
                  
                      # 'localhost' needs to be the last item for idempotency, see
                      # http://ansible.cc/docs/modules.html#mysql-user
                      - name: update mysql root password for all root accounts
                        mysql_user: name=root host={{ item }} password={{ mysql_root_password }}
                        with_items:
                          - "{{ ansible_hostname }}"
                          - 127.0.0.1
                          - ::1
                          - localhost
                  
                      - name: copy .my.cnf file with root password credentials
                        template: src=templates/root/my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600
                  
                      - name: delete anonymous MySQL server user for $server_hostname
                        action: mysql_user user="" host="{{ server_hostname }}" state="absent"
                  
                      - name: delete anonymous MySQL server user for localhost
                        action: mysql_user user="" state="absent"
                  
                      - name: remove the MySQL test database
                        action: mysql_db db=test state=absent
                  

                  templates/root/my.cnf.j2

                  [client]
                  user=root
                  password={{ mysql_root_password }}
                  

                  參考文獻

                  • Lorin Hochstein 的原始答案
                  • https://github.com/gaspaio/ansible-devbox/blob/master/roles/mysql/tasks/server.yml
                  • 這篇關于Ansible 冪等 MySQL 安裝 Playbook的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                    【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統)中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務計劃程序中的 PowerShell MySQL 備份腳本錯誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數據從 XML 文件導入 MySQL 數據庫)
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動時的錯誤)
                  Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫表)

                  <i id='RvGIA'><tr id='RvGIA'><dt id='RvGIA'><q id='RvGIA'><span id='RvGIA'><b id='RvGIA'><form id='RvGIA'><ins id='RvGIA'></ins><ul id='RvGIA'></ul><sub id='RvGIA'></sub></form><legend id='RvGIA'></legend><bdo id='RvGIA'><pre id='RvGIA'><center id='RvGIA'></center></pre></bdo></b><th id='RvGIA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RvGIA'><tfoot id='RvGIA'></tfoot><dl id='RvGIA'><fieldset id='RvGIA'></fieldset></dl></div>
                  • <small id='RvGIA'></small><noframes id='RvGIA'>

                        <tbody id='RvGIA'></tbody>
                        <legend id='RvGIA'><style id='RvGIA'><dir id='RvGIA'><q id='RvGIA'></q></dir></style></legend>
                        1. <tfoot id='RvGIA'></tfoot>
                            <bdo id='RvGIA'></bdo><ul id='RvGIA'></ul>
                            主站蜘蛛池模板: 精品www| 国产精品一区二区av | 91中文字幕在线 | 国产1区2区在线观看 | 一区二区三区中文字幕 | www.伊人.com | 超碰人人在线 | www国产成人 | 免费国产视频 | 波多野结衣在线观看一区二区三区 | 亚洲第一视频网站 | 九九伊人sl水蜜桃色推荐 | 日韩一区二区免费视频 | 亚洲欧美一区二区三区视频 | 天天天操 | 亚洲色图综合网 | 国产精品久久久久久久岛一牛影视 | 牛牛热在线视频 | 99精品电影| 国产高清亚洲 | 亚洲最大的黄色网址 | 日韩高清成人 | 免费午夜电影 | 国产在线中文字幕 | 国产一区二区在线视频 | 6080亚洲精品一区二区 | 精品国产成人 | 日韩高清一区 | 欧美高清视频一区 | 91精品国产综合久久香蕉922 | h漫在线观看 | 自拍偷拍av | 亚洲欧美在线视频 | 亚洲免费人成在线视频观看 | 久色激情 | 可以免费观看的av | 久久久久久影院 | 久久99精品久久久水蜜桃 | 美国一级片在线观看 | 精品一级| 国产69久久精品成人看动漫 |