arm uos mysql playbook

語言: CN / TW / HK

- hosts: 127.0.0.1
  remote_user: root
  vars:
    - version: 5.7.25
    - port: 3306
    - password: Linewell@2021
    - installDir: /home/ansible/mysql-5.7.33-ansible
  tasks:
    - name: start mysql install  install libaio1
      shell: dpkg -i  {{installDir}}/files/libaio1_0.3.112-3_arm64.deb
    - name: install libc6
      shell: dpkg -i  {{installDir}}/files/libevent-core-2.1-6_2.1.8-stable-4_arm64.deb
    - name: install libmecab2
      shell: dpkg -i  {{installDir}}/files/libmecab2_0.996-6_arm64.deb
    - name: install man-db
      shell: dpkg -i  {{installDir}}/files/man-db_2.8.5-2_arm64.deb
    - name: install net-tools
      shell: dpkg -i  {{installDir}}/files/net-tools_1.60+git20180626.aebd88e-1_arm64.deb
    - name: dpkg-preconfigure mysql-server
      shell:  debconf-set-selections mysql.txt
    - name: dpkg mysql-common
      shell:  dpkg -i {{installDir}}/files/mysql-common_5.8+1.0.5_all.deb
    - name: dpkg -i libmysqlclient20_
      shell:  dpkg -i  {{installDir}}/files/libmysqlclient20_{{ version }}-1_arm64.deb
    - name: dpkg -i mysql-client-core
      shell:  dpkg -i   {{installDir}}/files/mysql-client-core-5.7_{{ version }}-1_arm64.deb
    - name: dpkg -i mysql-client
      shell:  dpkg -i   {{installDir}}/files/mysql-client-5.7_{{ version }}-1_arm64.deb
    - name: dpkg -i mysql-server-core
      shell:  dpkg -i {{installDir}}/files/mysql-server-core-5.7_{{ version }}-1_arm64.deb
    - name: dpkg -i mysql-server
      shell:  dpkg -i {{installDir}}/files/mysql-server-5.7_{{ version }}-1_arm64.deb
    - name: copy conf
      template: src=mysqld.cnf dest=/etc/mysql/mysql.conf.d/mysqld.cnf
    - name: set password and host
      shell: mysql  -e "use mysql;UPDATE user SET password_expired='N' where user='root';update user set authentication_string=password('{{password}}') where user='root';update user set host = '%' where user = 'root';flush privileges;"
    - name: enable mysqld1
      shell:  systemctl enable mysql
    - name: restart mysqld
      shell:  systemctl restart mysql
    - name: add-port
      shell: iptables -I INPUT -p tcp --dport {{ port }} -j ACCEPT
    - name: restart firewall   mysql install end
      shell: iptables-save