From c2bcc1b4721e3d73072926bf2f3b8e9c41c0d1f8 Mon Sep 17 00:00:00 2001 From: Dmitry Figol Date: Mon, 23 Mar 2020 19:57:06 +0000 Subject: [PATCH] Delete /tmp/hosts before running gitlab plugin notebook cell, fix #498 --- .../tasks/version_control/gitlab.ipynb | 267 +++--------------- 1 file changed, 36 insertions(+), 231 deletions(-) diff --git a/docs/plugins/tasks/version_control/gitlab.ipynb b/docs/plugins/tasks/version_control/gitlab.ipynb index ece7b162..833597f1 100644 --- a/docs/plugins/tasks/version_control/gitlab.ipynb +++ b/docs/plugins/tasks/version_control/gitlab.ipynb @@ -14,10 +14,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "scrolled": false, @@ -91,10 +90,9 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 2, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "scrolled": true, @@ -138,10 +136,9 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 3, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "nbsphinx": "hidden", @@ -172,10 +169,9 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 4, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -212,10 +208,9 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 5, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -227,48 +222,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[1m\u001b[36mgitlab**************************************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "\u001b[1m\u001b[36mgitlab**************************************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO\u001b[0m\n", "\u001b[0m--- \n", "\n", "+++ hosts\n", @@ -277,34 +233,8 @@ "\n", "+127.0.0.1\t\tlocalhost\n", "+255.255.255.255\tbroadcasthost\n", - "+::1\t\tlocalhost" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "+::1\t\tlocalhost\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "\u001b[0m" ] } @@ -339,10 +269,9 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 6, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -378,10 +307,9 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 7, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -393,48 +321,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[1m\u001b[36mgitlab**************************************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "\u001b[1m\u001b[36mgitlab**************************************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO\u001b[0m\n", "\u001b[0m--- hosts\n", "\n", "+++ hosts\n", @@ -444,34 +333,8 @@ " 127.0.0.1\t\tlocalhost\n", " 255.255.255.255\tbroadcasthost\n", " ::1\t\tlocalhost\n", - "+8.8.8.8\t\tgoogledns" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "+8.8.8.8\t\tgoogledns\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "\u001b[0m" ] } @@ -509,18 +372,26 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 8, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { "slide_type": "-" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m\u001b[0m" + ] + } + ], "source": [ + "!rm -f /tmp/hosts\n", "result = n.run(\n", " gitlab,\n", " action=\"get\",\n", @@ -547,10 +418,9 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 9, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -562,48 +432,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[1m\u001b[36mgitlab**************************************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "\u001b[1m\u001b[36mgitlab**************************************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[34m* alpine ** changed : True *****************************************************\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33mvvvv gitlab ** changed : True vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO\u001b[0m\n", "\u001b[0m--- /tmp/hosts\n", "\n", "+++ /tmp/hosts\n", @@ -612,34 +443,8 @@ "\n", "+127.0.0.1\t\tlocalhost\n", "+255.255.255.255\tbroadcasthost\n", - "+::1\t\tlocalhost" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "+::1\t\tlocalhost\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[33m^^^^ END gitlab ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "\u001b[0m" ] } @@ -653,7 +458,6 @@ "execution_count": null, "metadata": { "autoscroll": false, - "collapsed": false, "ein.hycell": false, "ein.tags": "worksheet-0", "slideshow": { @@ -667,6 +471,7 @@ "metadata": { "kernelspec": { "display_name": "Python 3", + "language": "python", "name": "python3" }, "language_info": { @@ -679,7 +484,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.6.10" }, "name": "gitlab.ipynb" },