僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。
ansibleでリモートに送り込むファイル編集。
stretchかbusterかが面倒になってきた。
雛形をコピーするのでなく、その一部を置換するようにする。
--- - name: set sources.list template: src: sources.list.j2 dest: /etc/apt/sources.list owner: root group: root mode: 0644
sources.list.j2 は templatesの下に置いておく。
deb http://ftp.jp.debian.org/debian/ {{ debian_code }} main contrib non-free
変数debian_codeはhostsファイルに書いておいた。
debian_code = stretch
リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。