久久久久久久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的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

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

                  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.

                  當(dāng)執(zhí)行下面的 Playbook 時(shí),一切順利.但是當(dāng)我第二次運(yùn)行它時(shí),任務(wù) Configure the root credentials 失敗了,因?yàn)?MySQL 的舊密碼不再匹配,因?yàn)樗言谖疑洗芜\(yùn)行此 Playbook 時(shí)更新.

                  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 非冪等,我不喜歡.我希望能夠根據(jù)需要多次運(yùn)行 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
                  

                  解決這個(gè)問題的最佳方法是什么,這意味著使 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 }}
                  

                  參考文獻(xiàn)

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

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

                  相關(guān)文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產(chǎn)品、類別和元數(shù)據(jù)的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統(tǒng))中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務(wù)計(jì)劃程序中的 PowerShell MySQL 備份腳本錯(cuò)誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數(shù)據(jù)從 XML 文件導(dǎo)入 MySQL 數(shù)據(jù)庫)
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動(dòng)時(shí)的錯(cuò)誤)
                  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>
                            主站蜘蛛池模板: 国产精品国产精品国产专区不片 | 99精品在线 | 婷婷久久网 | 国产免费观看久久黄av片涩av | 天天综合国产 | 欧美日韩中文在线观看 | 日本一区二区影视 | 天天爽天天操 | 国产精品一区在线播放 | 欧美视频二区 | 亚洲精品欧洲 | 亚洲精品免费视频 | 91香蕉嫩草 | 国产精品久久久久久久岛一牛影视 | 天天操夜夜操 | 久久久久一区 | 欧美成年黄网站色视频 | av中文在线 | 夜夜爽99久久国产综合精品女不卡 | 天天操操 | 人人玩人人添人人澡欧美 | 91精品国产乱码久久久久久久久 | 日韩在线欧美 | 中文字幕在线免费观看 | 亚洲综合在线播放 | 欧美在线色| 黄色成人在线观看 | 久久欧美高清二区三区 | 午夜成人免费视频 | 天天操网| 在线视频a | 国产日韩欧美一区二区在线播放 | 欧美一级免费看 | 久久久综合精品 | 亚洲高清av在线 | 成人毛片网 | 亚洲欧美一区二区在线观看 | 户外露出一区二区三区 | 亚洲综合国产精品 | 涩涩导航 | 国产精品免费一区二区三区 |