Commit 234c52b9 authored by Hugo Levy-Falk's avatar Hugo Levy-Falk Committed by root

Ajout du bridge IRC telegram

parent e7bdb23e
# bridge.yaml
# Ce rôle installe le bridge telegram irc
---
- hosts: bridge
remote_user: root
roles:
- matterbridge
$ANSIBLE_VAULT;1.2;AES256;rezo
32393138663531656233383436366633656262626131623838626335383531313562316238323963
3366653137653161663135343065623130373938356566300a373634656135616433353261393532
38356636663939313733386535363137363134353437353461616231346166336633363864333361
3036616361303632340a656231613938626331656632376637333461656264336238303530326139
38353730323533363632313535316266656530376361666235643964393636346231303762343662
37383832303033333938663963303934616436636531323630373466643032383661643361346632
37386633303130333532393537656664646132333663653263623763353539313130663535313336
66356237353065333331333630663265646236306663303333373036643331643934366463346166
62376231346335653861643534376561343637353862653034386564396238313638303939646238
65333636393330336331396430386431306264626239356164333230363431316661313865336333
316362363063376263663864373461363665
36626236623765363661656231316562666635643534643461333561396635303035313836313634
3235353831333961363131366361366565616332666461370a626662303762356366653962653937
64633865393634356463623731393065363732303830616239666264643965316466396230386264
3965663362383762310a383464636662333030353862643331643164343634663365353031326465
32653862666366626338306135343765623435663732636234393465326661616461393734393364
37313736363039303063343734393232653931356335303363306133653932666263336362306631
31373261633837666638356461653933333530626662643066613666356330656136643364316232
65373239323630343434653634313737373135323936366231376134313538363034393632326262
31303265643963373338353962373037643736303663656530323965336134623365396433366163
62363330376530376230316664643833353032356561353330363532333136346231363561373836
30383333356565346531663762626237333930323835353164613339633330353331653433306131
35363932666464656637393663386533346330636563393661633965653063346638313064663062
63636534376562666136616639663030393261313338306237343738323536626337666533643266
3531383037623262386538376363666535623130373366636166
---
matterbridge_config:
version: 1.16.5
binary_checksum: 9ed2b0e31c4ea618dc02f8b55bdef5d9c2a802ffe3de9cf32acd7a00b8d59029
channels:
- name: campus
irc:
channel: "#campus"
telegram:
channel: -45394299
- name: bots
irc:
channel: "#bots"
telegram:
channel: -1001413424448
- name: rezo
irc:
channel: "#rezo"
telegram:
channel: -1001332906364
dionysos-new.rez
[re2o-dev]
10.7.0.13
......@@ -39,3 +40,13 @@ enki.rez
[games]
atlas.rezometz.org
[romrem]
romulus.rez
remus.rez
[cocobanger]
10.7.0.23
[bridge]
heimdall.rez
[Unit]
Description=Matterbridge
Requires=network.target
After=multi-user.target
[Service]
Type=simple
User=matterbridge
Group=matterbridge
WorkingDirectory=/etc/matterbridge
ExecStart=/usr/bin/matterbridge -conf matterbridge.toml
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target

:
½
║╦ .
║▒▒@,╓══="`
,.-═≡==⌂─=â╗╣▒▒▒▒▒`
.=─"` -─^` ╙▒▒ ╙Å╗,
,-─^` .¬`` ▒ ╫╣
-─` ` u ▒
 ▓▓▓▓▓▓▓▓▓▓▓▓▄∩` ▓▓█Γ  └ ╢Γ
 ▓▓▓▓▀▀▀▓██▓▓▓▓▄ ▀▀  { ╩Γ
 ▓▓▓▌≡" ▓▓▓▓ ▄▓▓▓▓▓▓▓▓ ╒▓▓▓▓▓▓▓▓▓▓▓▌ ▄▄▓▓▓▓▓▓▄  ╗Γ
 ▓▓▓▓▄▄▄▄▄▄▓▓▓▓▀ ▄▓▓▓▀▀▀▀▀▀▀ ▀▀▀▀▀▀▓▓▓▓▓▀ ╓▓▓▓█▀▀▀█▓▓▓▄,ó`
,ó▐▓▓▓▓▓▓▓▓▓▓▓▓▀` ▓▓▓▓▄▄▄▄▄▄▄ ▄▓▓▓▓▀ ▓▓▓▌ ▐▓▓▓
 ╒╜ ╒▓▓▓▌ █▓▓▓▄ ▓▓▓▓███████ ▄▓▓▓█Γ ▓▓▓▌ ,─▐▓▓▓
 ╒Å  ╒▓▓▓▌ ▀▓▓▓▌ █▓▓▓▄,,,,,, ▄▓▓▓▓▄,,,,, ▀▓▓▓▄Q,,▄▓▓▓▀
 ╗δ  ╒▓▓▓▌ ▐▓▓▓▓ ▐█▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▌-─`▀▓▓▓▓▓▓▓▀.
╒▒ ,-─`
▒╕ ,-─`
Å╣╕ ,.=─`
`╙┴=≡══╖╖╖---═≡==─"^`

---
# handlers file for matterbridge
- name: restart matterbridge
service:
name: matterbridge
state: restarted
# taken Here https://github.com/jwflory/ansible-role-matterbridge/blob/master/tasks/main.yml
- name: install golang (v1.8+ required)
package:
state: present
name: golang
- name: create matterbridge system user
user:
name: matterbridge
comment: "system user to run 42wim/matterbridge - do not use"
system: yes
home: "/etc/matterbridge"
create_home: no
# target_user is a global variable I define in an Ansible VCS repository. This
# task will be skipped if the `target_user` variable is not defined.
- name: add target user to matterbridge group
user:
name: "{{ target_user }}"
groups: matterbridge
append: yes
when: target_user is defined
- name: create/set permissions on /etc/matterbridge static config directory
file:
state: directory
recurse: yes
path: "/etc/matterbridge"
mode: 0755
owner: matterbridge
group: matterbridge
setype: etc_t
seuser: system_u
# Manually retrieve a sha512sum hash for a new release when updating this task.
- name: download matterbridge binary
get_url:
url: "https://github.com/42wim/matterbridge/releases/download/v{{ matterbridge_config.version }}/matterbridge-{{ matterbridge_config.version }}-linux-64bit"
checksum: "sha256:{{ matterbridge_config.binary_checksum }}"
backup: yes
dest: /usr/bin/matterbridge
mode: 0755
setype: bin_t
seuser: system_u
notify: restart matterbridge
- name: install /etc/matterbridge/matterbridge.toml
template:
src: matterbridge.toml
dest: "/etc/matterbridge/matterbridge.toml"
mode: 0640
owner: matterbridge
group: matterbridge
setype: etc_t
seuser: system_u
notify: restart matterbridge
- name: add /usr/lib/systemd/system/matterbridge.service (systemd unit file)
copy:
src: matterbridge.service
dest: "/etc//systemd/system/matterbridge.service"
mode: 0644
seuser: system_u
setype: systemd_unit_file_t
- name: start/enable matterbridge.service
service:
name: matterbridge
state: started
enabled: yes
[irc.rezometz]
Server="irc.rezometz.org:6667"
Nick="telegram"
RemoteNickFormat="<{NICK}> "
[telegram.rezometz]
Token="{{bridge_token}}"
RemoteNickFormat="<{NICK}> "
{% for channel in matterbridge_config.channels %}
[[gateway]]
name="{{channel.name}}"
enable=true
[[gateway.inout]]
account="irc.rezometz"
channel="{{channel.irc.channel}}"
[[gateway.inout]]
account="telegram.rezometz"
channel="{{channel.telegram.channel}}"
{% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment