[ansible] added
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -11,4 +11,5 @@ out/
|
|||||||
config.json
|
config.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
/node_modules
|
/node_modules
|
||||||
/log
|
/log
|
||||||
|
/ansible/*.retry
|
||||||
2
ansible/ansible.cfg
Normal file
2
ansible/ansible.cfg
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[defaults]
|
||||||
|
hash_behaviour = merge
|
||||||
2
ansible/dev/inventory.yml
Normal file
2
ansible/dev/inventory.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
all:
|
||||||
|
hosts: localhost
|
||||||
2
ansible/prod/inventory.yml
Normal file
2
ansible/prod/inventory.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
all:
|
||||||
|
hosts: shmyga.ru
|
||||||
1
ansible/roles/user/keys/shmyga.pub
Normal file
1
ansible/roles/user/keys/shmyga.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCot1zSeqj7Tj5/7aNMzXAuXQPPxudYFV9z6M03dPijh2bXyHDcXk53xUO8XY5R4GyLhvAn98axbPM++urKY8BXuQqAG36soI7iZJ/KcPY1EKDwVBeZneFC/wMc8HMT0hj9+uHcGAMtmklIgPPkawzLxbEh6oAY4H8Vvz08qyco6suYB5NjkpFwVMf9Xa2Fj8rTodKpPRDBh/Xk+5bh11RKL6b9WcwuwpKU8zl2qZiqNfjr0H+sKEk7ohcYvzSCltLdKJcoKbiCcnrnBJT5/JpGWeAbA2MMmvmt/dJrHykd1CbmXW2DuG4tIlwMb5xU739PoKCePctK1retb8TrWOLT shmyga@shmyga-desktop
|
||||||
40
ansible/roles/user/tasks/main.yml
Normal file
40
ansible/roles/user/tasks/main.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# barin
|
||||||
|
- name: Make barin group
|
||||||
|
group:
|
||||||
|
name: barin
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Make barin user
|
||||||
|
user:
|
||||||
|
name: barin
|
||||||
|
group: barin
|
||||||
|
password: '$6$mbw5KZWwtrRUy$eFcMNTW.QzG1Em45r5hZf/qri4hKAHImozWuW4/pYnDK.tOrVKrXTKYfRDtYEFRgCgVVg0zuPvyq/xn0KiKlz0'
|
||||||
|
groups: www-data,sudo,adm
|
||||||
|
|
||||||
|
- name: Set up authorized_keys for the barin user
|
||||||
|
authorized_key:
|
||||||
|
user: barin
|
||||||
|
key: '{{ item }}'
|
||||||
|
with_file:
|
||||||
|
- keys/shmyga.pub
|
||||||
|
|
||||||
|
|
||||||
|
# holop
|
||||||
|
- name: Make holop group
|
||||||
|
group:
|
||||||
|
name: holop
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Make holop user
|
||||||
|
user:
|
||||||
|
name: holop
|
||||||
|
group: holop
|
||||||
|
password: '$6$B/7g0xlcXFCIHk$hzSjb8KLll7YrTsp3z640sxNixNAkLpm6UUdZgWPh0Ffy7Ue18AiXTzkDdGTaTH6Woz4kvgVDSggnKGTU6u03.'
|
||||||
|
groups: www-data
|
||||||
|
|
||||||
|
- name: Set up authorized_keys for the holop user
|
||||||
|
authorized_key:
|
||||||
|
user: holop
|
||||||
|
key: '{{ item }}'
|
||||||
|
with_file:
|
||||||
|
- keys/shmyga.pub
|
||||||
1
ansible/roles/user/vars/main.yml
Normal file
1
ansible/roles/user/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ansible_become: yes
|
||||||
4
ansible/user.yml
Normal file
4
ansible/user.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- hosts: all
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- user
|
||||||
@@ -18,10 +18,8 @@ class WebSocketTools {
|
|||||||
|
|
||||||
public static function string2packet<P:Message>(data:String, packetClass:Class<P>):P {
|
public static function string2packet<P:Message>(data:String, packetClass:Class<P>):P {
|
||||||
var bytes = Base64.decodeBase64(data);
|
var bytes = Base64.decodeBase64(data);
|
||||||
var family = bytes.get(0);
|
|
||||||
var id = bytes.get(1);
|
|
||||||
var packet:P = Type.createInstance(packetClass, []);
|
var packet:P = Type.createInstance(packetClass, []);
|
||||||
packet.mergeFrom(bytes.sub(2, bytes.length - 2));
|
packet.mergeFrom(bytes);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user