<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                組成結構: Inventory Modules Ad Hoc Comands Playbooks Tasks: 任務 variables: 變量 templates: 模板 handlers: 案例1: ansible添加具有sudo權限的用戶 1)生成密碼 * 安裝pip [admin@node1 ~]$ sudo wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate * 生成密碼 #sudo pip install passlib [admin@node1 ~]$ python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())" Password: 輸入密碼 $6$rounds=656000$SiOogbD5vf7soBFY$bDX2gXdy5bpSBBx9KwglMhmYCLGfiZ0G4zCYhOzDOZcIANkcTf1ASuYtwFNH8zy145k7CMolOu7816VGFeihT0 2)編寫playbook ~~~ [admin@node1 ~]$ vim sudo_user.yml --- - hosts: webserver user: admin become: yes vars: user: test password: $6$rounds=656000$SiOogbD5vf7soBFY$bDX2gXdy5bpSBBx9KwglMhmYCLGfiZ0G4zCYhOzDOZcIANkcTf1ASuYtwFNH8zy145k7CMolOu7816VGFeihT0 tasks: - name: Add user {{ user }} user: name={{user}} comment="test user" uid=1057 - name: Config /etc/sudoers lineinfile: dest=/etc/sudoers state=present line='{{item}}' with_items: - "{{ user }} ALL=(ALL) NOPASSWD: ALL" ~~~ 3、執行過程 ~~~ [admin@node1 ~]$ ansible-playbook sudo_user.yml PLAY [webserver] *************************************************************************************************************************************************************************************************** TASK [Gathering Facts] ********************************************************************************************************************************************************************************************* ok: [192.168.20.138] ok: [192.168.20.137] TASK [Add user test] *********************************************************************************************************************************************************************************************** ok: [192.168.20.138] ok: [192.168.20.137] TASK [Config /etc/sudoers] ***************************************************************************************************************************************************************************************** changed: [192.168.20.138] => (item=test ALL=(ALL) NOPASSWD: ALL) changed: [192.168.20.137] => (item=test ALL=(ALL) NOPASSWD: ALL) PLAY RECAP ********************************************************************************************************************************************************************************************************* 192.168.20.137 : ok=3 changed=1 unreachable=0 failed=0 192.168.20.138 : ok=3 changed=1 unreachable=0 failed=0 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看